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)
 Unique Random values in SQl Server 2005

Author  Topic 

jaishankar
Starting Member

1 Post

Posted - 2008-01-14 : 06:49:45
How can I implement @Parameter in the Select Top * statement in SQL Server 2005

create Proc ProDemo(@N int)
as begin
select top (@N) * from CT_EDIApp_BatchMaster order by NEWID()
end

Regards,
Jai Shankar

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-01-14 : 06:57:53
quote:
Originally posted by jaishankar

How can I implement @Parameter in the Select Top * statement in SQL Server 2005

create Proc ProDemo(@N int)
as begin
select top (@N) * from CT_EDIApp_BatchMaster order by NEWID()
end

Regards,
Jai Shankar


Did you get any error?

Madhivanan

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

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-01-14 : 07:00:01
Check the database compatibility is set to 90.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -