views:

503

answers:

6

I have MS SQL Management Studio for editing table data, and it is doesn't have a good usability. I need to edit some hundred rows like in Excel, being able to order columns to easy editing process (SQL Mgmt only has 'Open table' feature, without ordering columns, updates diferent than that is only possible using UPDATE SQL code).

LinqPad is wonderful, but only for queries. I would like to edit table results.

I installed Acqua Studio and it has everything, but trial expired. Do you know any software free alternatives which can do that?

EDIT: I really need to alter and input data, of course I can do it by SQL code, but it is not fast when you have to update manually tons of rows. I need an editable ordered grid. I'll try MSManager Lite.

Thanks

+4  A: 

MS Access allows some flexibility: there's a good chance you'll have that installed already.

Either an adp or mdb (with linked tables) should allow you to do what you want (easier sorting, reordering columns etc to manage data.

gbn
Does it have any integration with SQL Server?
Victor Rodrigues
Yes. It gives you a flexible table view (reorder columns, sorting etc) but does not affect the table structure
gbn
+8  A: 

I would suggest learning the necessary SQL to update the appropriate data in the tables. You can use SELECT statements with ORDER BY clauses to view the data in the order that you wish to view it, and then build a query to update that data.

You can use transactions to make sure what your updating is correct as you go (if you are still learning the SQL and don't want to mess up the database).

BEGIN TRANSACTION -- starts a transaction
ROLLBACK          -- stops the transaction and rolls back all changes to the tables
COMMIT            -- stops the transaction and commits all changes to the tables

What are you trying to accomplish/update, maybe we can help you with that?

EDIT

You mentioned that you wanted to edit some product names that are stored inside of a table. and that this would be a one-time task. I've set up a small demo below that I hope will help guide you towards a solution that may work for your situation. copy and paste this into a SQL Management Studio session.

Also if you wanted, you can export your current data to say excel, edit that data in excel, import it as a new temporary table and run a SQL update script to update the original table.

/*
Products Before Update          Products After Update
===========================     =============================================
ID      ProductName             ID      ProductName
---------------------------     ---------------------------------------------
1       MSFT                    1       Microsoft Corp.
2       APPL                    2       Apple Inc.
3       Cisco Systems, Inc.     3       Cisco Systems, Inc.
4       IBM                     4       International Business Machines Corp.
5       JAVA                    5       Sun Microsystems, Inc.
6       ORCL                    6       Oracle Corp.
*/

-- Imagine that this table is a table in your database
DECLARE @products TABLE (
                        ID          INT,
                        ProductName VARCHAR(255)
                        )

-- And this table has some product information
-- which you are trying to update with new information
INSERT  @products
SELECT  1, 'MSFT' UNION ALL
SELECT  2, 'APPL' UNION ALL
SELECT  3, 'Cisco Systems, Inc.' UNION ALL
SELECT  4, 'IBM' UNION ALL
SELECT  5, 'JAVA' UNION ALL
SELECT  6, 'ORCL'

-- Either build an in-memory temporary table of the product names you wish to update
-- Or do a database task to import data from excel into a temporary table in the database
DECLARE @products_update TABLE  (
                                ID          INT,
                                ProductName VARCHAR(255)
                                )

INSERT  @products_update
SELECT  1, 'Microsoft Corp.' UNION ALL
SELECT  2, 'Apple Inc.' UNION ALL
SELECT  4, 'International Business Machines Corp.' UNION ALL
SELECT  5, 'Sun Microsystems, Inc.' UNION ALL
SELECT  6, 'Oracle Corp.'

-- Update the table in the database with the in-memory table
-- for demo purposes, we use @products to represent the database table
UPDATE      p1
SET         ProductName = ISNULL(p2.ProductName, p1.ProductName)
FROM        @products p1
LEFT JOIN   @products_update p2
        ON  p1.ID = p2.ID

-- Now your products table has been updated
SELECT      *
FROM        @products
Jon Erickson
+1, SQL is your friend, take a bit of time and learn it (at least the basics), it'll server you well through your career. Also, if you have any SQL questions there are plenty of people here that'll be glad to help you out.
Nathan Koop
What if business users have to update data? And it's a small shop etc etc
gbn
If usability is a factor for end-users not developers then SQL is not the answer, it is not clear from your question who is the target user. If it is you a developer then, learn SQL ASAP. :)
Ted Johnson
Never let users directly enter data to tables! They should have an application progrmmed for doing this that uses code you wrote and tested.
HLGEM
In the real world, you may not have the choice. They may just get rid of you and replace you withsomeone who says yes...
gbn
@gbn you should try to understand what the users are trying to accomplish, why they need to modify and/or delete data and give them the tools to accomplish that, ie. simple UI over stored procedures. if we give users free reign on tables you don't know what they will do with the data, and then it is on us (as developers) to clean up after them, when we should go in and try to understand up front what the needs of the users are. do you think the users WANT to mess around with tables and databases and connection strings, etc.?
Jon Erickson
I need to update product names, sql wouldn't help me enough, it is not something programming would do for me automatically, I really need to input/edit each row data. I need an ordered editable grid...
Victor Rodrigues
And it is only setup information. I will not display these data to be edited by the final user.
Victor Rodrigues
To all the critics: I'm a developer DBA (and have been a production DBA). I understand what you are saying but in real life, but in real life compromises happen. OP asked a question and all you've said is "don't do it". How is that helpful to the OP? @Johmn E: Developers don't clean up data: support and DBAs do. Where does it say he wants to let users mess aroud with DBa and conn strings?
gbn
And if you can't compromise, the business says "dor it or else", are you going to leave your job to maintain your high standards in ths current job market?
gbn
+1  A: 

You might consider just using Excel.http://support.microsoft.com/kb/306397/EN-US/ I Believe there are also Excel plug-ins/VB Macros that will make this integration tighter.

Otherwise MS Access is a reasonable answer, stated as well by gbn.

Ted Johnson
+3  A: 

I have this tool permanently on a USB stick - really, really good for a free "lite" edition (a pro version is available too)

http://sqlmanager.net/products/mssql/manager

It is a single monolithic exe, so great for portability.

-Oisin

x0n
Yeah, this sounds great, man, thanks
Victor Rodrigues
I'll test it after doing some work
Victor Rodrigues
It could be THE tool, but the grid can be ordered only by a single column. I need to order by several columns. Until now, Acqua Data Studio is the best option I've found, although it's not free.
Victor Rodrigues
+1  A: 

Use SQL Server Management Studio. You are using the Open function with a table, correct (right click the table -> Open)? Still do that, but look for the highlighted button:

http://www.bgalert.com/images/ssms1.jpg

You can then add an order by or whatever you feel like and hit the execute button as highlighted:

http://www.bgalert.com/images/ssms2.jpg

Gromer
The image urls seems broken.
Victor Rodrigues
That was annoying. Should work now, sorry about that.
Gromer
A: 

Consider Apex SQL Edit. It has all the features you mentioned, and more, though it's not free.

BTW, if you need only free products, you should edit your subject line to say so.

John Saunders