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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Add Column

Author  Topic 

slickhead
Starting Member

5 Posts

Posted - 2005-03-13 : 23:37:47
I am new to sql server. I am migrating my asp code from Access to sql server and I am having permissions problems when trying to add a column to a table using asp. When I view the permissions for my role, there are only a limited number of sql clauses present to choose from. ALTER TABLE is not present. How do I do this?

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-03-14 : 00:07:29

Use the SQL Server client tools:
Enterprise Manager or Query Analyzer



CODO ERGO SUM
Go to Top of Page

slickhead
Starting Member

5 Posts

Posted - 2005-03-14 : 12:33:05
I used the Query Analyzer and the "command was completed successfully". However, I still have the permissions problem when I use the same code in my asp page. The error message says that I do not have permission to add a column to the table. In my asp page, I have the following line of code...

ALTER TABLE Members ADD Howdy varchar(30)

When I look at the permissions set for that table, I have checked permission for SELECT, INSERT, UPDATE and DELETE. There is no selection for ALTER TABLE, DROP TABLE, ADD TABLE, etc.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-03-14 : 13:26:46
Alter table is not a permission that you set on a table.

You can do it if you are the owner of the table, or if you are in the sysadmin fixed server role, or db_ddladmin or db_owner fixed database roles.





CODO ERGO SUM
Go to Top of Page

slickhead
Starting Member

5 Posts

Posted - 2005-03-14 : 16:55:14
I noticed that I can indeed ALTER TABLE to a table I made using asp. Just not a table I imported from the original Access database. The owner is different. How can I change the owner of a table from "dbo" to the web user owner name? I can't see anything in the Enterprise Manager that will allow me to do this.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-03-14 : 20:22:17
You can change the object owner using procedure sp_changeobjectowner.

It is more normal to have dbo as the owner of all objects in the database. I am not sure why you would want to use ASP to manage the database objects, instead of using Enterprise manager or Query Analyzer.




CODO ERGO SUM
Go to Top of Page

slickhead
Starting Member

5 Posts

Posted - 2005-03-16 : 08:29:11
Thanks
Go to Top of Page
   

- Advertisement -