We have several instances in our project where we have to read into our SQL Server 2005 database from outside files using TSQL.
To make a long story short, this works:
but when we try to do this:
gives this error:
Cannot bulk load because the file "(path and file name)" could not be opened. Operating system error code 5(Access is denied.).
Ideas anyone?
TIA,
MMund
To make a long story short, this works:
Code:
create table ##Thrgl02(s varchar(8000))
set @as_bcp = 'bcp ##Thrgl02 in (path and file name) -T -c -S ' + convert(varchar,@ThisServerName)
exec master.dbo.xp_cmdshell @as_bcp
but when we try to do this:
Code:
create table ##Thrgl02(s varchar(8000))
bulk insert ##Thrgl02 from (path and file name) with (codepage = 'ACP')
Cannot bulk load because the file "(path and file name)" could not be opened. Operating system error code 5(Access is denied.).
Ideas anyone?
TIA,
MMund