Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Mass Insert using Except
-- ///////////SCHEMA/////////////////////////////////////////////////// CREATE TABLE Animals ([animal] varchar(255), [legs] int, [colour] varchar(255)) ; CREATE TABLE ObjectPermissions ([animal] varchar(255), [permission] varchar(255), [record] int, [test1] varchar(255), [test2] varchar(255), [test3] varchar(255) ) ; INSERT INTO Animals ([animal], [legs], [colour]) VALUES ('cat', 4, 'red'), ('bird', 2, 'yellow'), ('dog', 4, 'red'), ('deer', 4, 'red'), ('fish', 0, 'blue'), ('dingo', 4, 'yellow') ; -- //////////////////////////////////////////////////////////////////// DECLARE @applicationId INT SET @applicationId = 0 insert into ObjectPermissions select animal, '_SuperUser', 99, 'test1', 'test2', 'test3' from animals EXCEPT select animal, '_SuperUser', 99, 'test1', 'test2', 'test3' from animals where animal NOT IN ('dog', 'deer', 'dingo') select * from animals select * from ObjectPermissions
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Get amount of users that bought something soon after registration
math function
food_plan
bc160401693
Primeiro
Rextester.java
Outer Apply successer cell chek and get the result
Fatch data in xml format
store1
Common Table Expression
stackse - search stackoverflow differently
Please log in to post a comment.