Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to refer to a variable inside the table?

Status
Not open for further replies.

nljoco

Programmer
Dec 10, 2001
6
US
If I have the following code:
DECLARE @recordItem TABLE( field1 int, field2 int)

How will I refer to field1?
 

You reference a table variable like you reference a table.

Select Field1, Field2
From @recordItem
Where field1=1

Update @recorditem
Set field2=92
Where field1=3

Insert @recorditem (field1, field2)
Values (1, 45) Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top