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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table variables alias

Status
Not open for further replies.

mossbs

Programmer
Joined
Aug 19, 2008
Messages
102
Location
GB
hey guys,

having problems trying to alias a table variable in an update statement

syntax i have so far is....

Code:
update @all a
set a.jobtitle = c.job_title from contact
inner join contact c on c.individual_ref = a.ref and c.main_organisation = 'Y'
where a.addresstype = 'Business'

any ideas?

cheers.
 
Code:
update  a
set a.jobtitle = c.job_title
[red][b]FROM @all a[/b][/red]
inner join contact c on c.individual_ref = a.ref and c.main_organisation = 'Y'
where a.addresstype = 'Business'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top