Saturday, 28 December 2013

How to update table values in sql server 2008 example / sql server update query

Posted on 23:01 in
Introduction:
This article is helps to update table values using sql server in 2008 R2.
Method 1:
UPDATE [dbo].[STUDENTDETAILS]  SET [ID] = <ID, int,>,[NAME] = <NAME, varchar(20),>,[GENDER] = <GENDER, varchar(6),>,[DEPARTMENT] = <DEPARTMENT, varchar(50),> WHERE <Search Conditions,,>
GO
Example:
UPDATE STUDENTDETAILS SET DEPARTMENT='ECE' WHERE ID=1
UPDATE STUDENTDETAILS SET DEPARTMENT='EEE' WHERE ID=2
UPDATE STUDENTDETAILS SET DEPARTMENT='CSE' WHERE ID=3
GO
SELECT * FROM STUDENTDETAILS
Method 2:
Step1:
Expand TableàTable àRight ClickàEdit Top 200 Rows
 Step2:
Enter values in table column

0 comments:

Post a Comment