
Select getting table fields or setting variables?
In SQL, the select statement will get table fields, but I have just
found out, it will also set the value of a
variable within a stored procedure.
This seems very confusing.
How do I know what it is doing, and how do I make it do one or the
other.
I have ....
CREATE PROCEDURE sp_GetNextRegNum
AS
Select Reg,Reg_Number_id as RegID
FROM
Reg_Number
'-------
I want to get the reg number of the first record, and then delete that
record, once I have retrieved the
reg nbr.
Also,
What is a good book for SQL, I have several, but they cover they basics,
like select selecting
table fields names, not setting the values of variables and complex if
then statments.
Thank You for your help,
Laurence Nuttall -UCLA