Declare statement en maf voorbeeldje

Variables are declared in the body of a batch or procedure with the DECLARE statement and are assigned values with either a SET or SELECT statement. Cursor variables can be declared with this statement and used with other cursor-related statements. After declaration, all variables are initialized as NULL.


USE pubs 
DECLARE @find varchar(30) 
SET @find = 'Ring%' 
SELECT au_lname, au_fname, phone FROM authors WHERE au_lname LIKE @find 

Here is the result set:

au_lname au_fname phone
-------------------------------------- -------------------- ------------
Ringer Anne 801 826-0752
Ringer Albert 801 826-0752 




Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!