Hi gang.
I have a longish parameterized query consisting of several unions of bi-drectional outer joins. The resultant query just misses fitting into a single stored procedure (certain combinations of the parameters yield a nvarchar over 4000 characters). It has been suggested that I split the query in the sp into two parts, each in its own stored procedure, and then make a master stored procedure that executes both "mini" queries and unions THOSE together.
Interesting theory, but I can't get a union on the sp's to work. Is it me, or is it MS SQL2k?
Final segment of the master sp looks like:
exec usp_AllDat_p1 @dbowner, @table_name, @field_name
union
exec usp_AllDat_p2 @dbowner, @table_name, @field_name
where the @param are passed to the master upon calling it. Each "partial" sp runs as expected.
Any ideas?
I have a longish parameterized query consisting of several unions of bi-drectional outer joins. The resultant query just misses fitting into a single stored procedure (certain combinations of the parameters yield a nvarchar over 4000 characters). It has been suggested that I split the query in the sp into two parts, each in its own stored procedure, and then make a master stored procedure that executes both "mini" queries and unions THOSE together.
Interesting theory, but I can't get a union on the sp's to work. Is it me, or is it MS SQL2k?
Final segment of the master sp looks like:
exec usp_AllDat_p1 @dbowner, @table_name, @field_name
union
exec usp_AllDat_p2 @dbowner, @table_name, @field_name
where the @param are passed to the master upon calling it. Each "partial" sp runs as expected.
Any ideas?