﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss content posted by Rudy Panigas / Article Discussions / Article Discussions by Author  / Remove SQL Logins from All Databases and SQL Server / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 17:57:25 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Remove SQL Logins from All Databases and SQL Server</title><link>http://www.sqlservercentral.com/Forums/Topic549965-471-1.aspx</link><description>DROP LOGIN [domainName\userName] is good for both SQL and Windows users, and deletes also related users, for me this simple syntax more usable than your SP.</description><pubDate>Sun, 03 Jun 2012 10:48:58 GMT</pubDate><dc:creator>gleb.zalt</dc:creator></item><item><title>RE: Remove SQL Logins from All Databases and SQL Server</title><link>http://www.sqlservercentral.com/Forums/Topic549965-471-1.aspx</link><description>Thanks for sharing your knowledge.  I haven't tried it but it looks like the code won't actually work if the user owns something like a schema, etc.</description><pubDate>Tue, 21 Feb 2012 19:40:03 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Remove SQL Logins from All Databases and SQL Server</title><link>http://www.sqlservercentral.com/Forums/Topic549965-471-1.aspx</link><description>This script generates the script to drop users only for the users who don't own a schema.It would have been better if it can generate like that too. I'll try to edit this script.. and post here</description><pubDate>Thu, 11 Aug 2011 14:58:58 GMT</pubDate><dc:creator>@SQLFRNDZ</dc:creator></item><item><title>RE: Remove SQL Logins from All Databases and SQL Server</title><link>http://www.sqlservercentral.com/Forums/Topic549965-471-1.aspx</link><description>Nice script.  I had to add SID matching for my purposes.  It's possible that the name in sysusers is different from the login that it points to in syslogins.</description><pubDate>Fri, 29 Jul 2011 14:51:14 GMT</pubDate><dc:creator>Tim Lehner</dc:creator></item><item><title>RE: Remove SQL Logins from All Databases and SQL Server</title><link>http://www.sqlservercentral.com/Forums/Topic549965-471-1.aspx</link><description>No worries. FYI: I just edited my original post as the sp_dropuser is okay. It is just the sp_droplogin that needs to be enclosed. Looks like [ ] works as good as ' '.</description><pubDate>Fri, 29 Apr 2011 13:26:01 GMT</pubDate><dc:creator>ryan.hobbs</dc:creator></item><item><title>RE: Remove SQL Logins from All Databases and SQL Server</title><link>http://www.sqlservercentral.com/Forums/Topic549965-471-1.aspx</link><description>Hello Ryan,Thanks for the update. Guess I didn't think of this when I wrote the script as I have not seen anyone using the "." in the login name.Thanks,Rudy[quote][b]ryan.hobbs (4/29/2011)[/b][hr]Rudy,First thanks for posting the sp. The code it generates uses sp_dropuser and that does not work for usernames that contain periods.  One of the applications we use creates usernames in the following format:  vdb_First.Last[code="xml"]EXEC sp_droplogin vdb_First.Last[/code]results in:[code="xml"]Msg 102, Level 15, State 1, Line 1Incorrect syntax near '.'.[/code]Looks like you need to enclose your output with single quotes:[code="xml"]PRINT 'EXEC sp_dropuser ''['+ @DatabaseUser +']''' [/code]and[code="xml"]PRINT 'EXEC sp_droplogin '''+ @SpecificName +'''' [/code][/quote]</description><pubDate>Fri, 29 Apr 2011 13:04:48 GMT</pubDate><dc:creator>Rudy Panigas</dc:creator></item><item><title>RE: Remove SQL Logins from All Databases and SQL Server</title><link>http://www.sqlservercentral.com/Forums/Topic549965-471-1.aspx</link><description>Rudy,First thanks for posting the sp. The code it generates uses sp_dropuser and that does not work for usernames that contain periods.  One of the applications we use creates usernames in the following format:  vdb_First.Last[code="xml"]EXEC sp_droplogin vdb_First.Last[/code]results in:[code="xml"]Msg 102, Level 15, State 1, Line 1Incorrect syntax near '.'.[/code]Looks like you need to enclose your output like you did with the sp_dropuser:[code="xml"]PRINT 'EXEC sp_droplogin ['+ @SpecificName +']' [/code]</description><pubDate>Fri, 29 Apr 2011 12:50:19 GMT</pubDate><dc:creator>ryan.hobbs</dc:creator></item><item><title>RE: Remove SQL Logins from All Databases and SQL Server</title><link>http://www.sqlservercentral.com/Forums/Topic549965-471-1.aspx</link><description>Hello. Please let me know what you think about this code, changes, etc.Thanks,Rudy</description><pubDate>Tue, 12 Aug 2008 09:29:50 GMT</pubDate><dc:creator>Rudy Panigas</dc:creator></item><item><title>Remove SQL Logins from All Databases and SQL Server</title><link>http://www.sqlservercentral.com/Forums/Topic549965-471-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Security/63991/"&gt;Remove SQL Logins from All Databases and SQL Server&lt;/A&gt;[/B]</description><pubDate>Sun, 10 Aug 2008 20:50:38 GMT</pubDate><dc:creator>Rudy Panigas</dc:creator></item></channel></rss>