March 10, 2015 at 6:32 am
Please see pic
Can someone help me with the syntax on using BCP.
Here is my Requirements: I have a file that has a bunch of INSERT STATEMENTS. So the stuff inside the file looks like the following:
File has about 5000 rows.
INSERT INTO abc ( name ) VALUES ( 'Peter' );
INSERT INTO abc ( name ) VALUES ( 'Bob' );
March 10, 2015 at 6:48 am
bcp cannot help. bcp bulk loads data...it cannot execute each row as if it were a command.
open the file in SSMS and execute it instead. you might need to insert some GO statements every 1000 rows or so, just to make it bite sized so SSMS can handle it.
the syntax for opening a file and executing it via sqlcmd would work, but still, i'd recommend gui tools for just 5000 rows.
Lowell
March 10, 2015 at 7:19 am
I think this is what you are looking for...
http://databases.about.com/od/sqlserver/a/bcp.htm
I use to upload files using bcp bat files. It will insert all rows for you.
MCSE SQL Server 2012\2014\2016
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply