Hi,
Osql does not seem to like temp tables of any kind. I get errors when trying to run either one of these:
declare @cmd varchar(4000)
select @cmd = 'osql -E -Q "select * from @table" -o "C:\myfile.csv" -w500'
exec master..xp_cmdshell @cmd
-OR-
declare @cmd varchar(4000)
select @cmd = 'osql -E -Q "select * from #table" -o "C:\myfile.csv" -w500'
exec master..xp_cmdshell @cmd
Any ideas on how to work around this? I don't want to use a regular table.
Thanks
Osql does not seem to like temp tables of any kind. I get errors when trying to run either one of these:
declare @cmd varchar(4000)
select @cmd = 'osql -E -Q "select * from @table" -o "C:\myfile.csv" -w500'
exec master..xp_cmdshell @cmd
-OR-
declare @cmd varchar(4000)
select @cmd = 'osql -E -Q "select * from #table" -o "C:\myfile.csv" -w500'
exec master..xp_cmdshell @cmd
Any ideas on how to work around this? I don't want to use a regular table.
Thanks