Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Monster select
Message
From
20/11/2001 11:10:26
 
 
To
20/11/2001 10:23:57
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Miscellaneous
Thread ID:
00583822
Message ID:
00583964
Views:
21
>It's really hard to explain.
>Hope the example helps

I think I understand but my solution still holds. You can still combine multiple variables when you go to execute the query. You'll just have to be creative when it comes to building the string.

DECLARE @cmd1 nvarchar(4000), @cmd2 nvarchar(4000), @cmd3 nvarchar(3000)
DECLARE @worker nvarchar(4000), @cntr int

SET @cntr = 1

DO WHILE (something)
BEGIN
SET @worker = @worker + {new part of the query}

IF (len(@worker) > 3500)
BEGIN
IF @cntr = 1 SET @cmd1 = @worker
IF @cntr = 2 SET @cmd2 = @worker
IF @cntr = 3 SET @cmd3 = @worker
SET @worker = ''
END
...
END

EXECUTE (@cmd1 + @cmd2 + @cmd3)

Or something similar.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform