Reputation: 1115
I have used this syntax in Mysql :
insert into mytable set firstname='Jo' , set lastname='mvc' ;
Is that also valid in TSQL ?
Upvotes: 2
Views: 404
Reputation: 300728
No. For SQL Server you want this syntax for updates:
UPDATE mytable
SET firstname='Jo', lastname='mvc'
WHERE someCondition;
(assuming you don't want to update every row, you also need a WHERE clause)
and this for INSERTS:
INSERT INTO mytable (firstname, lastname)
VALUES ('Jo', 'mvc');
Upvotes: 4
Reputation: 138990
No. Insert statement should look like this
insert into mytable (firstname, lastname)
values ('Jo', 'mvc');
If you meant update it would look like this:
update mytable set
firstname='Jo',
lastname='mvc'
With a where clause after if you like.
Upvotes: 3