Link to home
Start Free TrialLog in
Avatar of spirose
spirose

asked on

SQL syntax

If I have a column 'Property' in Table 'TableTrial' with value 'EmployeeIDInitial|EmployeeIDFinal', how do I update the value of Property to (2 different values)
1.         'EmployeeIDInitial'
2.         'EmployeeIDFinal'
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

A field can have only one value, so you'll have to spell out the '2 different values' part.
Do you mean two different records, or two different columns?
== > to  update the EmpIdInitial value

update yourtable
set property = 'yourvalue'
from dbo.TableTrial
where property='EmployeeIDInitial'


===  > to update the EmpIdFinal Value

update yourtable
set property = 'yourvalue'
from dbo.TableTrial
where property='EmployeeIDInitial'
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of spirose
spirose

ASKER

Great- just what I needed
Thanks for the grade.  Good luck with your project.  -Jim