String Global Variable – Storing Text | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

String Global Variable – Storing Text

Does anyone know of any issues in storing a text column as a global variable? Is there a size limit to the string?
I think it may impact on the memory while calling by any API.
Why not create a global temp. table with this text datatype alone and call the reference. HTH _________
Satya SKJ
Moderator
SQL-Server-Performance.Com

The problem I’ve got that I have a number of T-SQL scripts stored in a table which need to be executed on a remote server not on the LAN. I can’t use a linked server due to the configuration (remote server isn’t part of a domain let alone a trusted domain) As part of a DTS package running on the remote server it needs to read in a script from the local server and execute on the remote server. I was thinking that I might be able to do with with global variables. I’m not sure how to do what you’re suggesting. I can create a temporary table on the remote server but I thought there was something preventing a data pump being able to access it withing DTS?
Apologies for my brain not being turned on today. I can simply transfer the table from the local server to the remote server then read it from there. [:I]
I really must learn to think before typing. Is there a way to execute a sql script that is larger than 8000 characters? I can’t use a local variable of type Text, Image or NText in order to store the script within and then run it with sp_executesql.
Store the script in stored procedure and call it when its required. _________
Satya SKJ
Moderator
SQL-Server-Performance.Com

]]>