Good Morning,
I work for a company that has sees alot of people come and go. The one thing I have noticed is that people use their admin accounts to log into SQL and create sp, views and databases.When the user leaves I am stuck with all these objects that are owned by somone no longer working for the company.
So my question to you guys is: What is the best practice to use in creating new objects?
Thanks for your guru-ness!
When you create objects make sure to use the prefix "dbo.". Example: Create procedure dbo.uspSomeProc|||Makes alot of sense. Now let me ask you this:
How would you keep track of who build what? Is there a way that procedure dbo.whatEverProc was created by me?
|||You can always drop/recreate the proc with dbo as the prefix. Alternatively you can check objects owned by a user thru this undocumented proc :sp_MScheck_uid_owns_anything @.uid
No comments:
Post a Comment