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.
| Author |
Topic |
|
kopzen
Starting Member
34 Posts |
Posted - 2008-07-15 : 05:46:03
|
| Hi guysThis is my stored procedure:ALTER procedure [dbo].[aidapr]asSELECTIpage, Rhost, Idevice, Ifield, Ivaluefrom dbo.latest_data order by RhostAnd the link below is my data output[url]http://img502.imageshack.us/img502/5079/mytablejl6.tif[/url]Based on the above,I want to create two parameters:1. Rhost (Server Names): Grabs all values related to the chosen Server from all columns.2. IPage (Components): Grabs all Component values related to the chosen ServerPlease check my link |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-15 : 06:02:20
|
| ALTER procedure [dbo].[aidapr](@Rhost varchar(50)),@IPage int)asSELECTIpage, Rhost, Idevice, Ifield, Ivaluefrom dbo.latest_data where Rhost=@Rhost and Ipage=@Ipageorder by RhostMadhivananFailing to plan is Planning to fail |
 |
|
|
kopzen
Starting Member
34 Posts |
Posted - 2008-07-15 : 06:06:08
|
| I get the following error message:Msg 1050, Level 15, State 1, Line 2This syntax is only allowed for parameterized queries.Msg 137, Level 15, State 2, Line 13Must declare the scalar variable "@Rhost". |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-15 : 06:12:27
|
| There is extra brace.Try thisALTER procedure [dbo].[aidapr](@Rhost varchar(50),@IPage int)asSELECTIpage, Rhost, Idevice, Ifield, Ivaluefrom dbo.latest_data where Rhost=@Rhost and Ipage=@Ipageorder by RhostMadhivananFailing to plan is Planning to fail |
 |
|
|
kopzen
Starting Member
34 Posts |
Posted - 2008-07-15 : 06:22:45
|
| Another Error message:Msg 201, Level 16, State 4, Procedure aidapr, Line 0Procedure or Function 'aidapr' expects parameter '@Rhost', which was not supplied.What does this mean? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-15 : 06:27:53
|
quote: Originally posted by kopzen Another Error message:Msg 201, Level 16, State 4, Procedure aidapr, Line 0Procedure or Function 'aidapr' expects parameter '@Rhost', which was not supplied.What does this mean?
When you execute the procedure, you need to supply the value for the input parametersEXEC aidapr 'somevalue',somenumberMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|