Syntax of Table Variable-
DECLARE @TestTable TABLE
(
Pid int,
Pdesc varchar(200)
)
You can use table variables in batches, stored procedures, and user-defined functions (UDFs). We can UPDATE records in our table variable as well as DELETE records.
Update @TestTable Set Pdesc ='PEN' where Pid =1
Select * from @TestTable
Advantage-It provide less locking and logging overhead than table Variable.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment