August 25, 2010 at 2:24 am
I am tring to update a column on one table from another.
Using the code below it parses ok but get the error multi part identifier cannot be found
update ct_user
set dbo.nt_name=ct_users1$._nt_name where dbo.ct_user.name =dbo.ct_users1$._staffName
any reason why i am getting this error.
Thanks,
Iain
August 25, 2010 at 3:07 am
looks like all you are missing is the FROM clause:
update ct_user
set dbo.nt_name = [ct_users1$]._nt_name
FROM [ct_users1$]
where dbo.ct_user.name = dbo.[ct_users1$]._staffName
Lowell
August 25, 2010 at 3:10 am
From what you've given us it's difficult to help, can't correct your code can just point you in the right way. Looks like you're missing a FROM clause to me.
UPDATE table_name
SET column_name = expression
FROM other_table_name
WHERE search_conditions
-EDIT- Lowell, you ninja. . . 😛
August 25, 2010 at 3:15 am
low hanging fruit, my friend; so easy i couldn't resist 😀
Lowell
August 26, 2010 at 7:28 am
Thanks for the advice guys managed to get it working with the following sql
update ct_user
set ct_user.nt_name =(select _nt_name from dbo.ct_users1$ where dbo.ct_user.name =dbo.ct_users1$._staffName)
😛
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply