Thanks, but I wanted to find a purely SQL solution if possible.
I like Tad's suggestion, but the ouput file from the SQL query comes out
looking weird. If I can get it to look normal, I should be able to osql out,
and osql in via xp_cmdshell.
-----Original Message-----
From: Jim Dorame
[mailto:mssqldba-ezmlmshield-x31533749.[Email address protected]
Sent: Tuesday, March 28, 2006 12:50 PM
To: LazyDBA Discussion
Subject: RE: how to send query output into a variable
Check this out. It may be of use to you.
http://searchsqlserver.techtarget.com/tip/1,289483,sid87_gci1135562,00.html?
FromTaxonomy=%2Fpr%2F301764
-----Original Message-----
From: Mordechai Danielov
[mailto:mssqldba-ezmlmshield-x52267166.[Email address protected]
Sent: Tuesday, March 28, 2006 11:44 AM
To: LazyDBA Discussion
Subject: how to send query output into a variable
Hello all,
I am running a query that generates a T-SQL script. I need to run that
script on a different server, which is straightforward enough with osql.
Problem is that the output of the first query is in several rows, and I need
it to be one string that can be passed to osql. I tried to use varchar(8000)
variable and concotenate the text with a loop, but that was a waste of time.
Any ideas?
Thanks
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
MS Sql Server LazyDBA home page