SQL Server Information and Resources Bookmark this page

SQLINFO.net is a Community Service from DataExpressions makers of dbOrchestra©

Google
 

 

 

 


SQL Server Examples

SQL DML

String Functions

Stored Procedures

SQL Views

SQL Table Basics


Misc SQL Server UPDATE Examples

UPDATE - Single row

Update a single row of data.

BEGIN TRANSACTION
GO

UPDATE [dbo].[Students]
SET    employee_id_fk                = '3208'  ,
       gender_code                   = 'F'     ,
       marital_status_code           = 'M'  
WHERE  student_id = 11  
GO

COMMIT TRANSACTION
GO

UPDATE - Update multiple rows

Update multiple rows of data..

BEGIN TRANSACTION
GO

UPDATE [dbo].[ClassConvenings]
SET     acitve_flg                    = 2  
WHERE   class_convene_date > '2005-1-01 00:00:00.0' 
   AND  class_convene_date < '2005-12-31 00:00:00.0'
GO

COMMIT TRANSACTION
GO  

 

 



Copyright 2006-2007 by DataExpressions --- All Rights Reserved            dbOrchestra - SQL Server home page