November 27, 2002 at 9:38 am
Hi,
I am attempting to call a stored procedure and pass(concatentate) 2 variables as 1 parameter to the stored procedure.
Example:
Declare @test-2 as varchar(8000)
Declare @Test2 as varchar(8000)
exec sp_Test @test-2 + @Test2
Can this be done and what would be the correct syntax everything I have tried seems to generate an error.
Note: I can't create a third variable and set, do to the fact variable lengths.
Edited by - cdipilato@xcelsoftware.com on 12/08/2002 07:56:36 AM
November 27, 2002 at 10:51 am
Due to the SQL limit of 8000 characters, I don't think what you are trying to do is possible.
If you reduce the variables to 4000, you can use a third variable
What is the proc using the data for?
Far away is close at hand in the images of elsewhere.
Anon.
November 27, 2002 at 10:53 am
Even though the parameter of the stored procedure I am tyring to pass to is text.
quote:
Due to the SQL limit of 8000 characters, I don't think what you are trying to do is possible.If you reduce the variables to 4000, you can use a third variable
What is the proc using the data for?
November 27, 2002 at 11:48 am
If the resulting field of the update in the proc is text then I suggest you pass each variable separately and use WRITETEXT and UPDATETEXT as appropriate.
Far away is close at hand in the images of elsewhere.
Anon.
December 3, 2002 at 10:18 pm
What you are proposing exceeds SQL Server 2000 design limitations and is not possible with maximum data lengths.
If you have actual TEXT values, add TEXT parameters to your stored proc(s) and use them as such.
December 7, 2002 at 7:18 pm
Even then when a stored procedure is run you cannot concatenate two vairables to a single parameter. Even if both where 4000 in length it is not valid syntax.
Then like David stated you can use a third variable to concatenate them then submit the third variable. It will generate
"Incorrect syntax near +"
December 8, 2002 at 7:28 am
quote:
Even then when a stored procedure is run you cannot concatenate two vairables to a single parameter. Even if both where 4000 in length it is not valid syntax.Then like David stated you can use a third variable to concatenate them then submit the third variable. It will generate
"Incorrect syntax near +"
Syntactially, yes but SQL Server still has a limit of +/- 8000 characters for a varchar column. This is a limit that cannot be exceeded with ANY tricks.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply