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 2000 Forums
 Import/Export (DTS) and Replication (2000)
 URGENT

Author  Topic 

muhiar
Starting Member

37 Posts

Posted - 2006-05-01 : 04:14:23
hi all
i have an urgent problem
what i am trying to do is to export the data from sql server table into text file
this export need to be scheduled for each hour

the problem is that i want data in the file to be seperated by <CR><LF> so does DTS enable us to change the column sperator??
and how? it does support for only comma , semicolon ,tab , vertical bar

i have tried to use bcp with format file but i always get the same error
bcp is not recognized as internal or external command
although it worked perfectly from the command prompt as well as i have inserted the path of bcp.exe in the system path envrionment variable and checked the command prompt
in the bcp i tried to add the path of bcp.exe but it does not work
??
what shall i do?
any ideas??
plz it is sooooooooooooooo urgent case

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-01 : 05:54:54
you can execute BCP from T-SQL via the xp_cmdshell



KH


Go to Top of Page

muhiar
Starting Member

37 Posts

Posted - 2006-05-01 : 06:02:08
i have created a stored procedure that uses the master..xp_cmdshell command
but it does not work
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-01 : 07:54:40
What is the error that you encountered ?



KH


Go to Top of Page

muhiar
Starting Member

37 Posts

Posted - 2006-05-01 : 09:47:05
bcp is not recognized as internal or external command
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-05-01 : 10:05:37
Check that the PATH includes the folder where BCP.EXE is located?

Kristen
Go to Top of Page

muhiar
Starting Member

37 Posts

Posted - 2006-05-02 : 01:34:42
i have included the bcp.exe path in the PATH system environment variables
Go to Top of Page

muhiar
Starting Member

37 Posts

Posted - 2006-05-02 : 01:35:50
but it did not work and i have used the path in the master..xp_cmdshell 'c:\path\bcp.exe' and this did not work
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-05-02 : 04:13:47
Are you still getting "bcp is not recognized as internal or external command" or a different error now?

Kristen
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-02 : 04:28:44
quote:
Originally posted by muhiar

but it did not work and i have used the path in the master..xp_cmdshell 'c:\path\bcp.exe' and this did not work




This does not looks like the normal installation path. Did you just copied BCP.exe from somewhere into C:\path ?


KH

Go to Top of Page
   

- Advertisement -