sql query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kavithaeee
    New Member
    • Sep 2007
    • 1

    sql query

    how to write sql query to insert files in database
  • jeenajos
    New Member
    • Oct 2007
    • 71

    #2
    Originally posted by kavithaeee
    how to write sql query to insert files in database
    Hi,
    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

    Comment

    • iburyak
      Recognized Expert Top Contributor
      • Nov 2006
      • 1016

      #3
      Originally posted by kavithaeee
      how to write sql query to insert files in database
      See my working example (I had 3 columns with Tab as a delimiter):

      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'
            )
      I would suggest inserting into temp table first and then into production evaluated version of it.

      If you need other ways to do it let me know but I like this one the most.
      Thank you.

      Good Luck.

      Comment

      Working...