I'm hoping someone out there can lend some assistance. I've been beating my head against a wall for a few days and have pretty much given up. Here's the deal... I have a stored procedure that calls the following line of code:
execute master..xp_cmdshell 'bcp "select * from intranet..btprintqueue" queryout d:\sqlbackup\printfile.dd -T -c -t,'If I run this sp from the query analyzer I get the following output:
SQLState = 42000, NativeError = 229
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]SELECT permission denied on object 'btprintqueue', database 'intranet', owner 'dbo'.
I can't seem to figure out where the permissions come from. BCP is run from a command line, so how do I set permissions so that it can read this table and others? This was working fine just 5 days ago. Someone has done something since then and I can't seem to figure out what it was.