How to insert and update data into a table with "insert" and "update" statements?



How to insert and update data into a table with "insert" and "update" statements..

Answer / Arpit Mishra

To insert new data into a table using the INSERT statement in SQL Server, you can use the following syntax:nn```sqlnINSERT INTO TableName (Column1, Column2) VALUES ('Value1', 'Value2');n``` Replace `TableName`, `Column1`, `Column2`, and `Value1`, `Value2` with your table name, column names, and the values you want to insert. To update existing data using the UPDATE statement, use the following syntax:nn```sqlnUPDATE TableNamenSET Column1 = 'New Value', Column2 = 'New Value'nWHERE Condition;n``` Replace `TableName`, `Column1`, `Column2`, and `Condition` with your table name, column names you want to update, the new values for those columns, and a condition that specifies which rows should be updated.n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What happens if the update subquery returns multiple rows in ms sql server?

1 Answers  


How to test values returned by a subquery with the in operator?

1 Answers  


What are system databases into sql server (2005/2008) : sql server database administration

1 Answers  


How do I start sql server agent automatically?

1 Answers  


code to create procedure for taking databse backup in sql server or i have the query for it but what it's query returns means i want to show on my jsp that the databse backup has been taken on the basis of that return value.does it returns 0 or 1.wat is the code for that

1 Answers   IGT,


List out different types of normalizations in sql server and explain each of them?

1 Answers  


What is difference between TRUNCATE and DELETE statement

12 Answers   CTS,


What is the order by used for?

1 Answers  


What is database replication?

1 Answers  


How to stop a loop early with break statements in ms sql server?

1 Answers  


what is Archive old data?

1 Answers  


how to select a field with firstletter as capital and remaining are small letters

11 Answers  


Categories