I need to find a record in a SQL database and be able to manually edit the data. So far, I can't seem to find a quick method to just find the record by specific column data.
Does anyone know of any quick and simple methods to do this?
Printable View
I need to find a record in a SQL database and be able to manually edit the data. So far, I can't seem to find a quick method to just find the record by specific column data.
Does anyone know of any quick and simple methods to do this?
So I just wrote a simple query, which looks like this:
SQL Code:
SELECT * FROM _table WHERE _column='string'
It shows the row data... but I can't edit it at all. Any ideas? I know running a 'query' probably means just that. But, surely there's a way to find a row and edit the data manually, right?
you mean like a simple select statement?
select * from someTable where someField = someCriteria?
that's what I use... and then to update:
update tblSomething
set field = newvalue
where someField = someCriteria
-tg
SQL Server doesn't work that way... there's apps out there that allow the "Editing" of the data in a grid, but it's just running Updates on the back end....
Don't want to mess things up? Me neither... that's why I'll put BEGIN TRANSACTION before I start mucking with the data... I'll then add a COMMIT TRANSACTION and a ROLLBACK TRANSACTION at the end and comment them out... then when the update runs, it's in a transaction... if things go wrong, I select ROLLBACK TRANSACTION and run it... if things are ok,... I can run a couple of quicjk queries to check the data and if it's good COMMIT TRANSACTION
-tg
If you wish to edit data visually in a grid, try out Toad For SQL Server (freeware).
Click this link and look at the panel on the left where it says "Freeware" under "Downloads".
You do need admin privileges to install this tool.
In SQL Server Management Studio you can right click on the table and select "Edit top 200 rows". Once they come up right click on the grid, from the menu select Pane then SQL. Edit the query to bring back what you want and then you can edit it right from there.