Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Adding records to tables

Author  Topic 

DataD
Starting Member

3 Posts

Posted - 2011-06-17 : 10:59:41
I am a web designer needing to make one simple change to an SQL database namely updating a PortalAlias table for a DotNetNuke site. I have MS SQL Management Studio up and running and connecting to the database I need. But I cannot find the right button to push to get the PortalAlias table to add a record. Can anybody tell me what I am missing?

David Berkowitz

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-06-17 : 11:03:35
Open a query window

insert PortalAlias (col1, col2, col3, ...) select val1, val2, val3, ...
then hit <alt>x and it will run.

You could also right click on the table, edit top 200 rows and use the gui but better to use a query and save it as a record.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

DataD
Starting Member

3 Posts

Posted - 2011-06-17 : 11:13:27
quote:
Originally posted by nigelrivett

Open a query window

insert PortalAlias (col1, col2, col3, ...) select val1, val2, val3, ...
then hit <alt>x and it will run.

You could also right click on the table, edit top 200 rows and use the gui but better to use a query and save it as a record.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.


I tried using the gui but could not find any way to add a record below the existing one. There are no buttons or menu items for this purpose that I can find. I would prefer this approach as it is more direct. Also the exiting record in marked "read only" so possibly the table is somehow locked.

David Berkowitz
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-06-17 : 11:41:14
The insert statement is more direct than the gui.
I have never used the gui - maybe your connection doesn't have permission to update the table.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

DataD
Starting Member

3 Posts

Posted - 2011-06-17 : 11:46:07
quote:
Originally posted by nigelrivett

The insert statement is more direct than the gui.
I have never used the gui - maybe your connection doesn't have permission to update the table.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.


I bit the bullet and used the SQL query you recommended and that worked. Thanks for your help and your very quick response. Deeply appreciated.


David Berkowitz
Go to Top of Page
   

- Advertisement -