thanks erland, I am not generating the insert from another code, and i know i could have hard coded it directly by using senior or junior, but i was in the middle of writing a code, and decided to just manipulate the data and it wasnt working.
use
Learning
GO
IF OBJECT_ID ('dbo.SelectQueries','U') IS NOT NULL
DROP TABLE dbo.SelectQueries
CREATE TABLE dbo.SelectQueries(
Name VARCHAR (60),
LastName VARCHAR (60),
Email VARCHAR (60),
Salary int,
Employmentstart date default (sysdatetime()),
Monthduration int,
Country varchar (60),
Categories varchar (60)
)
;
GO
INSERT into
dbo.SelectQueries
(Name,LastName,Email,Salary,Monthduration,Country,Categories)
VALUES
('Ted','Click','tedc@robus.co.uk',50000,2,'United Kingdom',
CASE WHEN Salary >= 35000 THEN 'Senior' ELSE 'Junior' END)
i tried this and it did not work
No comments:
Post a Comment