Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Passing [nText] as a parameter in Stored procedure

Author  Topic 

Shivani
Starting Member

4 Posts

Posted - 2002-05-15 : 08:01:17
Are there any concerns on passing a nText data type as a parameter to a stored procedure. That is any kind of performance or optimization issues.

Regards,
Shivani

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-15 : 08:50:23
No performance or optimization issues, just be aware that you have to pass the ntext as a literal value (meaning you can't assign the contents of an ntext column to the variable and then pass it), nor can you modify the ntext variable inside the procedure. If you're just going to pass it and then INSERT or SELECT it then you'll be fine.

Go to Top of Page

Shivani
Starting Member

4 Posts

Posted - 2002-05-16 : 00:24:27
Hi robvolk,
Thanks for the reply. Just to be more clear, Is it fine to write

sp_myStoredProcedure(
@str as nText,
@iErrCode as integer)

As

Declare @strTemp as nText
Set @strTemp = Left(@str, 10)
Set @iErrCode = @@Error

--Use strTemp in further calculations


Go


Please write the reason if it should not be done this way,

Regards,
Shivani

Go to Top of Page

mohamedyousuff@yahoo.com
Starting Member

24 Posts

Posted - 2002-05-16 : 02:48:45

I tried the sp. It gave this error message

"The text, ntext, and image data types are invalid for local variables"






quote:

Hi robvolk,
Thanks for the reply. Just to be more clear, Is it fine to write

sp_myStoredProcedure(
@str as nText,
@iErrCode as integer)

As

Declare @strTemp as nText
Set @strTemp = Left(@str, 10)
Set @iErrCode = @@Error

--Use strTemp in further calculations


Go


Please write the reason if it should not be done this way,

Regards,
Shivani





Go to Top of Page

Shivani
Starting Member

4 Posts

Posted - 2002-05-16 : 02:56:08
Hi mohamed,
Thanks for the reply. I got the answer.

Regards,
Shivani


Go to Top of Page
   

- Advertisement -