Click here to Skip to main content
15,899,679 members
Home / Discussions / Database
   

Database

 
AnswerRe: Database logic... Pin
Mycroft Holmes28-Jun-08 21:59
professionalMycroft Holmes28-Jun-08 21:59 
QuestionSQL AGENT x64 version Pin
rafaelq200027-Jun-08 4:45
rafaelq200027-Jun-08 4:45 
Questionselect top query Pin
brettokumar27-Jun-08 3:41
professionalbrettokumar27-Jun-08 3:41 
AnswerRe: select top query Pin
Colin Angus Mackay27-Jun-08 3:48
Colin Angus Mackay27-Jun-08 3:48 
GeneralRe: select top query Pin
SomeGuyThatIsMe27-Jun-08 9:00
SomeGuyThatIsMe27-Jun-08 9:00 
GeneralRe: select top query Pin
Pete O'Hanlon27-Jun-08 11:02
mvePete O'Hanlon27-Jun-08 11:02 
AnswerRe: select top query Pin
Ashfield27-Jun-08 3:51
Ashfield27-Jun-08 3:51 
AnswerRe: select top query [modified] Pin
SomeGuyThatIsMe27-Jun-08 8:58
SomeGuyThatIsMe27-Jun-08 8:58 
in sql server 2000 try

create procedure ss(@s int)

as

SET ROWCOUNT @s
select sno from summa1 order by newid
SET ROWCOUNT 0

ROWCOUNT should turn pink..i havnt used it in a while so i may have typed it wrong. I do not believe that Rowcount is available in sql server 2k5, it was replaced with something but i dont remember what.

EDIT: ROWCOUNT is the correct one..@@ROWCOUNT wont work.

you could also use dynamic sql like

EXEC 'SELECT TOP ' + CAST(@s AS CHAR) + ' sno FROM summa1 ORDER BY newid'

Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

modified on Friday, June 27, 2008 4:16 PM

GeneralRe: select top query Pin
Ashfield27-Jun-08 9:29
Ashfield27-Jun-08 9:29 
GeneralRe: select top query Pin
SomeGuyThatIsMe27-Jun-08 10:16
SomeGuyThatIsMe27-Jun-08 10:16 
GeneralRe: select top query Pin
Ashfield27-Jun-08 10:22
Ashfield27-Jun-08 10:22 
GeneralRe: select top query Pin
Alsvha29-Jun-08 20:35
Alsvha29-Jun-08 20:35 
GeneralRe: select top query Pin
SomeGuyThatIsMe30-Jun-08 2:09
SomeGuyThatIsMe30-Jun-08 2:09 
Questionerror connecting to remote sql server Pin
karthi8427-Jun-08 1:49
karthi8427-Jun-08 1:49 
AnswerRe: error connecting to remote sql server Pin
Marek Grzenkowicz27-Jun-08 2:50
Marek Grzenkowicz27-Jun-08 2:50 
GeneralRe: error connecting to remote sql server Pin
karthi8427-Jun-08 3:09
karthi8427-Jun-08 3:09 
GeneralRe: error connecting to remote sql server Pin
Marek Grzenkowicz27-Jun-08 4:10
Marek Grzenkowicz27-Jun-08 4:10 
GeneralRe: error connecting to remote sql server Pin
karthi8430-Jun-08 1:10
karthi8430-Jun-08 1:10 
QuestionRecords in sql server Pin
iamdking26-Jun-08 23:51
iamdking26-Jun-08 23:51 
AnswerRe: Records in sql server Pin
Mycroft Holmes27-Jun-08 1:11
professionalMycroft Holmes27-Jun-08 1:11 
GeneralRe: Records in sql server Pin
iamdking27-Jun-08 1:48
iamdking27-Jun-08 1:48 
GeneralRe: Records in sql server Pin
Ashfield27-Jun-08 2:41
Ashfield27-Jun-08 2:41 
GeneralRe: Records in sql server Pin
Mycroft Holmes27-Jun-08 4:13
professionalMycroft Holmes27-Jun-08 4:13 
QuestionI need to transfer data between tables within a database Pin
jmohan26-Jun-08 20:37
jmohan26-Jun-08 20:37 
AnswerRe: I need to transfer data between tables within a database Pin
Mycroft Holmes27-Jun-08 1:15
professionalMycroft Holmes27-Jun-08 1:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.