Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 inserting daata into a table using a spreadheeet .

Author  Topic 

soulchyld21
Starting Member

28 Posts

Posted - 2012-04-13 : 07:52:11
Hi, can anyone point me in th right direction, I would like to insert data into a table using a .csv file, Can I do this using a sql statement? I cant use the import data wizard as Id like to automate the insertion process and my spreadsheets only ever hold 50 lines of data max, just seems a waste of time using the wizard!

mfemenel
Professor Frink

1421 Posts

Posted - 2012-04-13 : 08:34:17
look at openrowset in books online. That should give you what you need.

Mike
"oh, that monkey is going to pay"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-04-13 : 11:20:52
Another method is bulk insert

http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

soulchyld21
Starting Member

28 Posts

Posted - 2012-04-13 : 16:00:44
Thanks, much appreciated,
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-04-13 : 16:07:49
wc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -