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)
 VARCHAR SELECT in Stored Proc

Author  Topic 

endsabruptly
Starting Member

12 Posts

Posted - 2004-11-15 : 10:06:32
I am needing some quick advice. When the select at the end runs, it turns up nothing. To run this in the query analyzer, i need to put single quotes around @THEIRID. What do I need to do to get this to work correctly?

CREATE PROCEDURE dbo.EFM_WNG

@THEIRID VARCHAR(25)

AS
DECLARE @MS_NUMBER AS VARCHAR(7)


SELECT @MS_NUMBER=OURID FROM sp_EFM_XREF WHERE THEIRID = @THEIRID

DustinMichaels
Constraint Violating Yak Guru

464 Posts

Posted - 2004-11-15 : 10:12:10
You need to put single quotes around the input parameter to your stored procedure because it is a varchar. It sounds like it is working correctly to me.

Dustin Michaels
Go to Top of Page

endsabruptly
Starting Member

12 Posts

Posted - 2004-11-15 : 10:16:24
<bonehead>
I declared my varchar value as too small
</bonehead>
Go to Top of Page
   

- Advertisement -