Quantcast
Channel: BCP
Viewing all articles
Browse latest Browse all 3

BCP

0
0

Hi everybody. We are trying to bcp data from over 30 tables from SQL 2008 to 2000

I have both sybase and sql server on my server

I did it with cmd, but when i do it with management studio

DECLARE @cmd varchar( 250),@way varchar (100)

    select @cmd = @way+ 'bcp database.dbo.' + 'table' + ' out ' + 'c:\' +
       'table' + '.txt -S ' + @@servername + ' -c -t, -U sa -P password'
    select @cmd = 'master..xp_cmdshell ''' + @cmd + ''''
    exec( @cmd)

I get the error : CTLIB Message: - L6/08/S5/N3/5/0:
ct_connect(): directory service layer: internal directory control layer error:
Requested server name not found.
Established connection failed.

I changed the path in envinronment variables so that SQL Server binn path would be the first to find, but i didn't succeed.

The path to bcp is  C:\Program Files\Microsoft SQL Server\100\Tools\Binn

How should i write script in SSMS  so that sql server would use the bcp not from sybase server?

Or should i bcp all 30 tables in cmd?

 


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images