Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SP ntext output parameter

Status
Not open for further replies.

NervousRex

Programmer
Sep 4, 2003
66
US
I need to output a ntext data column in a stored procedure, but i'm getting an error:

Error 409: The assignment operator operation cannot take a ntext data type as an argument.


The decleration is as follows:

@Comments as ntext OUTPUT

The assignment is:

@Comments = Comments



How can I output the comments value while assuring i will not lose any of the text?
 
SQL Server does seem to contradict itself here. It explicitly states that:

BOL said:
Text, ntext, and image parameters can be used as OUTPUT parameters

and you can indeed create a proc with text parameters.

However I don't quite understand how you can assign any value to the parameter as it also says this under SET @local_variable:

BOL said:
@local_variable Is the name of a variable of any type except cursor, text, ntext, or image

--James
 
You can CAST ntext AS VARCHAR(8000). so if the commentator is not too wordy
Code:
SELECT @Comments = CAST( Comments AS VARCHAR(8000) ) FROM MyTable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top