Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server if exists update else insert

if exists(SELECT * from Student where FirstName='Akhil' and LastName='Mittal')            
BEGIN            
 update Student set FirstName='Anu' where FirstName='Akhil'  
End                    
else            
begin  
insert into Student values(1,'Akhil','Mittal',28,'Male',2006,'Noida','Tenth','LFS','Delhi')  
end 
Comment

PREVIOUS NEXT
Code Example
Sql :: sqlite create integer column with limit 
Sql :: dynamics 365 x++ aggregate querybuilddatasource 
Sql :: fill a column in database with a value 
Sql :: starting mysql service from mac 
Sql :: oracle current timestamp 
Sql :: create email address from first and last name in sql 
Sql :: change default maximum runtime mariadb from phpmyadmin 
Sql :: sometimes i cant edit sql developer 
Sql :: oracle kill job by sid 
Sql :: oracle list datafiles in tablespace 
Sql :: mysql remove definers 
Sql :: oracle session date format 
Sql :: psql human readable 
Sql :: oracle character index 
Sql :: Are NULL values in a database the same as that of blank space or zero? 
Sql :: oracle split string 
Sql :: async await mysql nodejs 
Sql :: create table mysql example auto_increment 
Sql :: remove spaces sql server 
Sql :: postgresql create table with boolean column 
Sql :: oracle search columns in schema 
Sql :: psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user 
Sql :: how to find date from date table in sql 
Sql :: mysql select last row for each group 
Sql :: how to check current user in mysql 
Sql :: how to delete git repo locally 
Sql :: script to add datafile to tablespace 
Sql :: Object of class mysqli_result could not be converted to string 
Sql :: sql select all from table 
Sql :: join to find results not in another table 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =