Click here to Skip to main content
15,891,828 members
Home / Discussions / Database
   

Database

 
QuestionHow to select 10-15 records? Pin
FishiFishi1-Aug-07 21:31
FishiFishi1-Aug-07 21:31 
AnswerRe: How to select 10-15 records? Pin
phantanagu1-Aug-07 22:18
phantanagu1-Aug-07 22:18 
AnswerRe: How to select 10-15 records? Pin
Blue_Boy1-Aug-07 22:36
Blue_Boy1-Aug-07 22:36 
AnswerRe: How to select 10-15 records? Pin
kubben2-Aug-07 2:46
kubben2-Aug-07 2:46 
Questionsql sever 2005 supports to generate E-mails ,Do you know to do this ? Pin
prasadbuddhika1-Aug-07 19:02
prasadbuddhika1-Aug-07 19:02 
AnswerRe: sql sever 2005 supports to generate E-mails ,Do you know to do this ? Pin
andyharman1-Aug-07 23:10
professionalandyharman1-Aug-07 23:10 
QuestionMerging data tables together Pin
steve_rm1-Aug-07 15:28
steve_rm1-Aug-07 15:28 
QuestionStored Proc StartValue and EndValue [modified] Pin
ASPnoob1-Aug-07 15:08
ASPnoob1-Aug-07 15:08 
Hi, I got the following from a tutorial on using store procedure for custom paging and I'd like to have few questions answered.
CREATE PROCEDURE uspPaging
@nStartValue INT,
@nEndValue INT
AS
SET NOCOUNT ON

DECLARE @tblTempData TABLE
(
nID INT IDENTITY,
EmployeeID INT,
LastName VARCHAR(50),
FirstName VARCHAR(50),
SupervisorID NCHAR(5)
)

INSERT INTO @tblTempData
(
EmployeeID,
LastName,
FirstName,
SupervisorID
)
SELECT
EmployeeID,
LastName,
FirstName,
ReportsTo
FROM Employees
ORDER BY
EmployeeID,
FirstName

SELECT EmployeeID,
LastName,
FirstName,
SupervisorID
FROM @tblTempData
WHERE nID BETWEEN @nStartValue AND @nEndValue
ORDER BY
nID ASC

What I don't understand is how does the computer know what the values of @StartValue and @EndValue are if they are not initialized. In this tuturial and another one I was reading, the @ symbols are used in naming the variables. Is it a must to use the @ symbol as the prefix of the variable name? Also does Between mean that if StartValue = 1 and EndValue = 5, then only EmplpoyeeID = 2 through 4 will be returned? Thank you in advance for your help.






-- modified at 23:57 Wednesday 1st August, 2007
AnswerRe: Stored Proc StartValue and EndValue Pin
_Damian S_1-Aug-07 18:14
professional_Damian S_1-Aug-07 18:14 
GeneralRe: Stored Proc StartValue and EndValue Pin
ASPnoob1-Aug-07 19:02
ASPnoob1-Aug-07 19:02 
GeneralRe: Stored Proc StartValue and EndValue Pin
_Damian S_1-Aug-07 19:57
professional_Damian S_1-Aug-07 19:57 
GeneralRe: Stored Proc StartValue and EndValue [modified] Pin
ASPnoob1-Aug-07 20:53
ASPnoob1-Aug-07 20:53 
GeneralRe: Stored Proc StartValue and EndValue Pin
_Damian S_2-Aug-07 1:58
professional_Damian S_2-Aug-07 1:58 
QuestionHelp me Pin
maram20001-Aug-07 13:56
maram20001-Aug-07 13:56 
AnswerRe: Help me Pin
Christian Graus1-Aug-07 14:55
protectorChristian Graus1-Aug-07 14:55 
AnswerRe: Help me Pin
Paul Conrad1-Aug-07 16:36
professionalPaul Conrad1-Aug-07 16:36 
QuestionConvert to Stored Proc [modified] Pin
ASPnoob1-Aug-07 10:44
ASPnoob1-Aug-07 10:44 
AnswerRe: Convert to Stored Proc Pin
Mike Dimmick1-Aug-07 11:42
Mike Dimmick1-Aug-07 11:42 
QuestionHandling null values with SqlDataReader Pin
eggie51-Aug-07 7:24
eggie51-Aug-07 7:24 
AnswerRe: Handling null values with SqlDataReader Pin
Pete O'Hanlon1-Aug-07 9:05
mvePete O'Hanlon1-Aug-07 9:05 
AnswerRe: Handling null values with SqlDataReader Pin
Pete O'Hanlon1-Aug-07 9:31
mvePete O'Hanlon1-Aug-07 9:31 
GeneralRe: Handling null values with SqlDataReader Pin
eggie51-Aug-07 18:46
eggie51-Aug-07 18:46 
AnswerRe: Handling null values with SqlDataReader Pin
Mike Dimmick1-Aug-07 11:48
Mike Dimmick1-Aug-07 11:48 
GeneralRe: Handling null values with SqlDataReader Pin
Pete O'Hanlon2-Aug-07 10:02
mvePete O'Hanlon2-Aug-07 10:02 
Questionsql 2005 not installing [modified] Pin
costavo1-Aug-07 2:35
costavo1-Aug-07 2:35 

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.