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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 BCP

Author  Topic 

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2007-01-17 : 21:36:46
Hi All,

I have a flat file named as Sec_Role.txt
The inputs are like

Role_Id Role_name
1 A
2 B

But I just wanted to move the records in Sql Server Sec_role table.How can i do thru BCP Utility. I just want to send this script into my clients place. So i have go to bcp utility.
Can anyone able to help me please..!

Thanks and regards
Krishnakumar.

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2007-01-18 : 00:03:48
http://msdn2.microsoft.com/en-us/library/ms162802.aspx
The url above is how to use the bcp utility, but I always use the openrowset function it's described in the below url.

http://www.databasejournal.com/features/mssql/article.php/3584751
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-01-18 : 07:12:53
Imports usually use bulk insert rather than bcp
something like
bulk insert mytbl from 'c:\Myfile.txt' with (fieldterminator=' ')


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -