how to write sql query to insert files in database
sql query
Collapse
X
-
Tags: None
-
Hi,Originally posted by kavithaeeehow to write sql query to insert files in database
Do u want to insert data into database?? Or specifically files??
To insert data
U can give insert query.
INSERT into tablename(field 1,field2...)Val ues(value1,valu e2,value3..)
Thanks -
See my working example (I had 3 columns with Tab as a delimiter):Originally posted by kavithaeeehow to write sql query to insert files in database
I would suggest inserting into temp table first and then into production evaluated version of it.Code:CREATE TABLE SomeTable (Results1 varchar(1000) null, Results2 varchar(1000) null, Results3 varchar(1000) null) BULK INSERT [SomeTable] FROM '\\nyinfrep001\ftproot$\Import\test.txt' WITH ( FIELDTERMINATOR = ' ', ROWTERMINATOR = '\n' )
If you need other ways to do it let me know but I like this one the most.
Thank you.
Good Luck.Comment
Comment