Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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
hhhhhhhhhhh
food_plan
t
SQL Directives Order of Execution
Life cycle
emp 4
SQL_Joins_RankingFunctions
Test if a string can be made with substrings!
Xml Shredding
TestTable