Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

do bcp script

Status
Not open for further replies.

calvi

Technical User
May 26, 2003
87
NL
There is a script is not working I think it has to do with because the name of the database consists of 2 separate words, e.g.: Adventure Works. I was told that I can do it with double quotes between these 2 words. But the script is not working yet.
the script is like this:
SET SCHEMA="Adventure Works"

for %%T in ( -- here comes all the tables -- )
DO bcp %SCHEMA%.dbo.%%T out bcp\%%T.bcp -S %SRC_SERVER% -U %SRC_USER% -P %SRC_PWD% -n -q >> %INSTALL%.log

for %%T in ( -- here comes all the tables -- )
DO bcp %SCHEMA%.dbo.%%T in bcp\%%T.bcp -S %DEST_SERVER% -T -E -b 1000 -k -h "TABLOCK" -n -q >> %INSTALL%.log

so I don't know why this does not work. Any ideas?
 
there is also a script used in T sql:
like this:
USE Adventure Works
GO

Is this correct or do I have to make a quote or something else?
 
All names that have "illegal" chars in them (space, some special chars) must be rounded with square brackets:
Code:
USE [Adventure Works]
GO

Borislav Borissov
VFP9 SP2, SQL Server 2000,2005 & 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top