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 2005 Forums
 Transact-SQL (2005)
 Trying to add another parameter

Author  Topic 

muzzettemm
Posting Yak Master

212 Posts

Posted - 2008-10-29 : 15:17:40
Hi all me again

I am trying to add @Enter_FirstName parameter to this procedure but I am getting error messages.


ALTER PROCEDURE [dbo].[AdvSearchExclusion]

( @Enter_LastName nvarchar(25)
@Enter_FirstName nvarchar(25))


AS



IF patindex( '*', @Enter_LastName ) > 0

BEGIN

SET @Enter_LastName = replace( @Enter_Lastname, '*', '%' )



SELECT

[Last Name],

[First Name],

IR#,

[Issue Date],

[Date Served], [Exp Date], DOB, Sex, [Reason For Exclusion], [Duration]

FROM [dbo].[Extended Exclusions]

WHERE [First Name] LIKE @Enter_LastName

END

ELSE

BEGIN

IF patindex( '*', @Enter_LastName ) > 0
SET @Enter_LastName = replace( @Enter_LastName, '*', '%' )
SELECT [Last Name], [First Name], [Issue Date], IR#, [Date Served], [Exp Date], DOB, Sex, [Reason For Exclusion], [Duration]
FROM [dbo].[Extended Exclusions]
WHERE ([Last Name] LIKE @Enter_LastName
or [First Name] LIKE @Enter_FirstName)

ORDER BY [First Name]

END

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2008-10-29 : 15:19:19
Add a comma , between paramaters...

Webfred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

muzzettemm
Posting Yak Master

212 Posts

Posted - 2008-10-29 : 17:01:49
Ok got it thank you, well that was a silly question I should have seen that
thank you
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2008-10-29 : 17:15:11
Another pair of eyes often sees more...

Greetings
Webfred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

muzzettemm
Posting Yak Master

212 Posts

Posted - 2008-10-29 : 19:13:49
That is so true Webfred thank you so much
Go to Top of Page
   

- Advertisement -