Search
 
SCRIPT & CODE EXAMPLE
 

SQL

insert or update sql query

REPLACE INTO devices(id,name) 
VALUES 
   (4,'Central Printer')
Comment

update or insert sql

begin tran
if exists (select * from table with (updlock,serializable) where key = @key)
begin
   update table set ...
   where key = @key
end
else
begin
   insert into table (key, ...)
   values (@key, ...)
end
commit tran
Comment

PREVIOUS NEXT
Code Example
Sql :: inner join vs outer join 
Sql :: datatables server side filter where clause 
Sql :: quit mysql 
Sql :: sql like operator 
Sql :: mysql insert multiple rows based on select 
Sql :: between operator 
Sql :: oracle select into and inner join 
Sql :: Example SQL Test 
Sql :: mysql update one table from another table multiple columns 
Sql :: sql logo 
Sql :: sql example 
Sql :: Oracle Procedure ex2 
Sql :: oracle database status v$logfile 
Sql :: ring MySQL get a list of columns names 
Sql :: 10000000000000000000 am to meters 
Sql :: hallo 
Sql :: edad en oracle 
Sql :: PDOException: SQLSTATE[HY093]: Invalid parameter numb 
Sql :: sql trigger difference between for and after 
Sql :: sql convert to linq online 
Sql :: plus or add balance in postgresql sql 
Sql :: concatenate sqlites 3 
Sql :: least spark sql 
Sql :: sql delete all except 
Sql :: Components/Fields of Internal Table 
Sql :: except in sql alchemy 
Sql :: heroku postgres permission denied 
Sql :: why we have to set the password for my sql server 
Sql :: plsql function that return a table 
Sql :: postgresql GRANT role_2 TO role_1 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =