Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL 7 - DbOwner Status in Groups

Posted on 1999-07-09
4
Medium Priority
?
275 Views
Last Modified: 2012-08-14
We have a SQL 7 set of databases, and we need to grant dbowner permissions on specific databases to groups of people.  I have set up groups on NT, and in SQL, but the dbowner property fails when we run reports requiring sql to drop a table.  The dbowner property works, and the report runs fine, for users who are defined separately in sql (with the same dbowner properties as the groups).  PLEASE tell me that there is something I am missing...and that I don't have to enter each of my users as a separate SQL login.  Any suggestions/solution ideas are appreciated!
0
Comment
Question by:jhoran
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
Mujeeb082598 earned 800 total points
ID: 1096291
Hi :)

First tell me are objects created by all the users in the group and if it is true then object created by one user will not be droped by another user.

That is the reason when each user separetly connect and drop, the user is the only one who own the objects and that is why can drop without any problem.

To work as a group u should recommend the user to explicitly add dbo as the owner of the object during creation. This way all the users can access and drop the objects without any problem.

Hope this give u insight.
0
 

Author Comment

by:jhoran
ID: 1096292
How do you assign DBO rights to temp tables, when the stored procedure drops any leftover temp tables (the IF EXISTS command) at the beginning, then creates a temp table (SELECT * from TABLE A INTO TEMPTABLE B) for the SP, and drops all temp tables at the end of the SP?

These stored procedures are used to create online reports for several users which have been placed in a group in NT.
0
 
LVL 5

Expert Comment

by:Mujeeb082598
ID: 1096293
Hi :)

The way u are creating temp tables is not correct, temp tables in sqlserver are prefixed with the # sign (## sign for global temp tables), and are droped automatically when they are out of scope let say in your case they will exist for the duration you run the procedure and the moment u exit from the procedure the tables are dropped automatically (here i am talking about local temp table).

What u have to do is in your procedure first creat the table with the create table syntax and make sure you prefix it with the # sign and then insert the records into it using the INSERT...SELECT command.

For for information on using temp tables please see CREATE TABLE command syntax in books on line and read the Temporary Tables section.
0
 

Author Comment

by:jhoran
ID: 1096294
This worked!  Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question