question

djtreble avatar image
djtreble asked

SQL data editing

I am VERY new to Microsoft SQl and need to know how to edit data in a row in a table, how do I display the contents of a table, then edit a selected row's data?
sqldataedit
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Magnus Ahlkvist avatar image
Magnus Ahlkvist answered
If I understand your question correctly, you are asking about how to - from an application - you can SELECT data, look at it, edit it and then have the application UPDATE the data in SQL Server. If that's the case, you should look at an ADO.NET tutorial, which will step-by-step guide you through the data access and data manipulation from within .NET. Here's an example - [ http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson01.aspx][1] - but there are tons more if you google for it. [1]: http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson01.aspx
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sorry for editing your answer, but I only added the link as an URL
0 Likes 0 ·
ThomasRushton avatar image
ThomasRushton answered
Alternatively, if you are the DBA and have access to the right tools, and it's an adhoc job, then you can fire up SQL Server management Studio and do it through the GUI. If running SQL Server 2005, Start->Run "sqlwb" If running SQL Server 2008, Start->Run "ssms" Connect to the right server; navigate down to the correct database, expand the "Tables" tree, right-click on the table you wish to edit and select "Open" (in 2005), or (I think) "Edit top 200 rows". (If the Top 200 rows don't contain the data you require, then you can click on an icon that says "Show SQL pane", and alter your query to suit.)
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Definitely good options to have for some ad hoc uses, but be aware that the performance can be abysmal compared to using select and update statements, and they can sometimes cause locking issues. I use these gui tools regularly, but only for tweaking small test data sets on test and development servers.
0 Likes 0 ·
Zahid avatar image
Zahid answered
I want to be very simple in understanding you question. I can not see any .Net or any thing else. I think you might ask only SQL command for updating data of a row. See the command below: UPDATE table_name SET field_name = new value WHERE condition Too see the data of a table: SELECT * FROM table_name. If this is not the desired answer, plz accept my apology
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.