Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-07-15 : 20:36:48
|
| Jennifer writes "I have an OpenQuery statement - see code belowset @squery = N'Select * From Openquery(CORE, ''select ' + Cast(@CorTrans as varchar(10)) + ' = transactions, ' + cast(@CorSales as varchar(10)) + ' = totalsales from core.amlaptop.dbo.actualday where yearid = ' + cast(@yearid as varchar(4)) + ' and periodid = ' + cast(@periodid as varchar(2)) + ' and dayid = ' + cast(@dayid as varchar(3)) + 'and unitid = ' + cast(@Unit as varchar(4)) + ''')'exec sp_executeSQL @squeryWhat I'd like to do is use @CorTrans and @CorSales in calculations once the query has run, but once "exec sp_executeSQL @squery"runs, @CorTrans and @CorSales are empty.Please help me and show what I am doing wrong.I am using SQL Server 2000 and Windows 2000 Pro. edition.Thanks!Jennifer" |
|
|
|
|
|