Sunday, March 11, 2012

DECLARE Table

Can anyone give me an example on how to use DECLARE to create a table
variable?
Thanks in advance
DimitrisDECLARE @.T TABLE(COL1 INT, COL2 CHAR(3))
"Dimitris Milonas" <gnout@.hotmail.com> wrote in message
news:u29$Yx3sFHA.2348@.tk2msftngp13.phx.gbl...
> Can anyone give me an example on how to use DECLARE to create a table
> variable?
> Thanks in advance
> Dimitris
>|||Start here:
http://msdn.microsoft.com/library/d...br />
66w5.asp
Continue here:
http://msdn.microsoft.com/library/d...br />
7ysl.asp
declare @.tableVar table (
Col1 int identity (1, 1)
,Col2 varchar(32)
,Col3 ntext
..etc, etc...
)
ML|||Dimitris,
See follwoing example
========================================
==========
DECLARE @.Student TABLE
(
Student_Name varchar(50),
Student_ID int
)
SELECT * FROM @.Student
========================================
==========
I am sure this will definite will work... pls do let me know... in
case of any issue..
Regards
Hari Sharma

No comments:

Post a Comment