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
 General SQL Server Forums
 New to SQL Server Programming
 Help with Parametrs

Author  Topic 

kopzen
Starting Member

34 Posts

Posted - 2008-06-25 : 10:37:55
Hi

Below is my simple stored procedure without Parameters:

ALTER procedure [dbo].[aidapr]
as
SELECT
Ipage,
Rhost,
Idevice,
Ifield,
Ivalue
from dbo.latest_data;



Rhost contains the PC name
So I wanted to use parameters so that I can get only Specific PC values;
So this is what I tried and I get errors:

ALTER procedure [dbo].[aidapr]
( @Rhost nvarchar (50) = '%')
as
SELECT
Ipage ,
Rhost,
Idevice,
Ifield,
Ivalue
from dbo.latest_data
Where @Rhost Like '*' order by Rhost

I dont know what Im doing wrong, all I want to do is type the PC name then get all its values


madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-25 : 10:41:00
Is this?

Where Rhost Like @Rhost+'%' order by Rhost


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -