RE: how to send query output into a variable

RE: how to send query output into a variable

 

  

-w is width of output for isql... I'd try running your initial script as
an isql job that then outputs the next script file to be run... of
course a DTS package might be a better process for what ever you are
attempting as it offers better controls and faster throughput. Then
again using 4 part notation and setting up linked servers and executing
your "script" as part of a variable pasted into sp_executesql would be
better still as the server might actual get some reuse of execution
plan... just some ideas for you to consider...



Tad Huck
{Database Czar - "If you can't learn to do something well, learn to
enjoy doing it poorly."}

REAL PAGE INC.
4000 International Parkway
Carrollton, Texas 75007-1913
(972) 820-3432.
-----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



This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message.

MS Sql Server LazyDBA home page