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
 Transact-SQL (2000)
 Passing ntext variable to a store procedure

Author  Topic 

chrispy
Posting Yak Master

107 Posts

Posted - 2002-02-24 : 02:38:51
Next in my ntext questions.
How do I pass a ntext variable through a SP.
I am using Cold Fusion and the variables are id'ed by the pound signs. i.i #foo#
MS SQL is looking for this

EXEC @RC = [Critech_Cart].[dbo].[upspec_HTML] @product_id, <@sav_html ntext>
In CF I send it this

EXEC[Critech_Cart].[dbo].[upspec_HTML] #ps#', '#content#'

Of course I am getting an error. Any thoughts as to the correct format?

Thanks again,
Chris

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-02-24 : 04:43:53
What is the error ?

Damian
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2002-02-24 : 05:19:07
How are you declaring the ntext variable in the sp?

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page

chrispy
Posting Yak Master

107 Posts

Posted - 2002-02-24 : 09:29:02
Mud on face here.
In attempting to get a useful error, I found the problem. Nothing to do with the ntext field at all. If you look at the first EXEC you will notice that I am forgetting a single quote around the first var #ps# (a nvarchar(40)) and nothing to do with the ntext. I guess passing it the way I, wsa ok.
Here is the original SP anyways.

Thanks,
Chris



ALTER PROCEDURE dbo.upspec_HTML
@product_id nvarchar(40), @sav_html ntext
AS
INSERT INTO Spec_HTML (Product_ID, sav_HTML)
VALUES (@Product_ID, @sav_html)

Go to Top of Page
   

- Advertisement -