chrisdoesstuff
Technical User
SQL server express 2008. I know I'm not doing something correct to pass the parameter to the query but I'm not positive what I'm doing wrong so hopefully you can help me.
ALTER procedure [dbo].[Shortname2]
@icd91 NVARCHAR (55)
AS
BEGIN
DECLARE @icd92 NVARCHAR (55)
SET NOCOUNT ON;
SELECT *
INTO #rowwwr
FROM dbo.ClinTeam
WHERE descriptivename LIKE '%ability%'
SELECT *
INTO #roFROM dbo.Diso
WHERE descriptivename = '@icd91'
SELECT * FROM #rowwwr
SELECT * FROM #ro
DROP TABLE #rowwwr
DROP TABLE #ro
END
If I leave the where clause for the first table (ro a string it works fine. If I try to change the code to WHERE descriptivename LIKE '%@icd91%' then it returns no values. I tried using SET @icd92 =@icd9 but it returns no values. Can anyone tell me what I'm doing wrong?
Thanks!
ALTER procedure [dbo].[Shortname2]
@icd91 NVARCHAR (55)
AS
BEGIN
DECLARE @icd92 NVARCHAR (55)
SET NOCOUNT ON;
SELECT *
INTO #rowwwr
FROM dbo.ClinTeam
WHERE descriptivename LIKE '%ability%'
SELECT *
INTO #roFROM dbo.Diso
WHERE descriptivename = '@icd91'
SELECT * FROM #rowwwr
SELECT * FROM #ro
DROP TABLE #rowwwr
DROP TABLE #ro
END
If I leave the where clause for the first table (ro a string it works fine. If I try to change the code to WHERE descriptivename LIKE '%@icd91%' then it returns no values. I tried using SET @icd92 =@icd9 but it returns no values. Can anyone tell me what I'm doing wrong?
Thanks!