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)
 quotename in stored proc

Author  Topic 

kaus
Posting Yak Master

179 Posts

Posted - 2001-07-17 : 17:56:08
I'm using the following stored procedure to select data. The problem is that it works if Project_Index is 5 or 6 but not if it is 5A or 6A. The Project_Index column is varchar -- do I need to use dynamic sql here, or is there a trick I'm missing ?? Thanks
CREATE PROCEDURE sp_proj_name_detail
@strID as varchar(5)
AS
select
Project_Index, Project_Name, Agency_Name, Type_Name, Second_Type,
App_Link, map_layer, map_link, Auth_Pkg_Link
from
Projects, Agencies, Types
where
Projects.Agency_Code = Agencies.Agency_Code and
Projects.Type_Code = Types.Type_Code and
Projects.Project_Index like quotename(@strID)
print quotename(@strID)


   

- Advertisement -