March 20, 2009 at 4:47 pm
How can i delete login and schema from all the databases including server.
I orphan logins by using sp_validatelogins and want to delte them.
March 22, 2009 at 4:35 pm
After you write the script to delete from each database the schema/users you can use the Microsoft shipped function for each database to do the job...
Read up at http://www.dbazine.com/sql/sql-articles/larsen5/.
Thanks.
Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
Microsoft FTE - SQL Server PFE
* Some time its the search that counts, not the finding...
* I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]
March 23, 2009 at 6:38 am
There is an undocumented sp: sp_msforeachdb. By using this you can run the script for all databases at once.
Eg:
EXEC sp_Msforeachdb "DBCC checkdb ('?')"
http://www.sqlservercentral.com/articles/Advanced+Querying/sp_msforeachdb/182/
March 23, 2009 at 11:10 am
Just mention for what purpose.and why?
[font="Comic Sans MS"]+++BLADE+++[/font]:cool:
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply