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 Utility

Author  Topic 

sanjay5219
Posting Yak Master

240 Posts

Posted - 2014-11-13 : 02:40:51
Hi All,

Can you suggest how to execute BCP command in SQL. I have to transfer Emp_Master Table into Notepad

Below are the details
Table Name - Emp_Master
File_Path - E:\Emp_Master.txt

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-11-13 : 06:22:28
BCP is actually a command line utility.

http://msdn.microsoft.com/en-us/library/ms162802.aspx

if you need to execute it from SQL, you will need to use xp_cmdshell

http://technet.microsoft.com/en-us/library/ms175046%28v=sql.110%29.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2014-11-13 : 06:26:22
bcp DBName.SchemaName.Emp_Master out 'E:\Emp_Master.txt' -c -T

--
Chandu
Go to Top of Page
   

- Advertisement -