question

Sathyanath avatar image
Sathyanath asked

BCP Error SQLState = S1000, NativeError = 0 , Unable to open BCP host data-file

Hi, I am trying to execute below BCP query in my TEST Server, where BCP has connection string to production DB, So my destination folder is in my Test Server and I am getting error, I think its permission related issue. DECLARE @str NVARCHAR(2000), @path NVARCHAR(200)='Z:\SQL' , @TableName NVARCHAR(100)='tblUsers' Set @str = 'BCP IDB.dbo.'+@TableName+ ' OUT '+@path +'\'+@TableName+'.csv -c -t^| -T -S ProductionServerName\SQL2012' Exec xp_cmdshell @str Print (@str) = BCP IDB.dbo.tblUsers OUT Z:\SQL\tblUsers.csv -c -t^| -T -S ProductionServerName\SQL2012 **ERROR:** output SQLState = S1000, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]Unable to open BCP host data-file NULL I share my Test Server folder to Production User account. Also I mapped the share folder drive in network share in production and run below SQLstatements, EXEC XP_CMDSHELL 'net use Z: \\TestServevrName\Test' EXEC XP_CMDSHELL 'Dir Z:' Still I am facing the same Issue. Please guide me what steps to follow to fix this permission issue, Many Tanks.
sql-server-2008-r2sql server 2012dbasql querydba-developer
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.