<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Check If A Login Exists In SQL Server 2008</title>
	<atom:link href="http://www.thereforesystems.com/check-if-a-login-exists-in-sql-server-2008/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thereforesystems.com/check-if-a-login-exists-in-sql-server-2008/</link>
	<description>a learning effort by Deepak Kapoor</description>
	<lastBuildDate>Thu, 09 Feb 2012 13:29:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Yugandhar</title>
		<link>http://www.thereforesystems.com/check-if-a-login-exists-in-sql-server-2008/comment-page-1/#comment-87769</link>
		<dc:creator>Yugandhar</dc:creator>
		<pubDate>Thu, 07 Apr 2011 08:20:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.thereforesystems.com/check-if-a-login-exists-in-sql-server-2008/#comment-87769</guid>
		<description>Thanks. very useful article.</description>
		<content:encoded><![CDATA[<p>Thanks. very useful article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry Mallett</title>
		<link>http://www.thereforesystems.com/check-if-a-login-exists-in-sql-server-2008/comment-page-1/#comment-81554</link>
		<dc:creator>Jerry Mallett</dc:creator>
		<pubDate>Mon, 21 Mar 2011 08:51:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.thereforesystems.com/check-if-a-login-exists-in-sql-server-2008/#comment-81554</guid>
		<description>This is great!!!! but.....

What if you wanted to continue with another statement if the user existed.  
IF NOT EXISTS(SELECT name FROM sys.server_principals WHERE name = &#039;test_user&#039;)
BEGIN
    CREATE LOGIN test_user WITH PASSWORD = &#039;Password123&#039;
END

If it does exist how can we carry on executing other statements or can we just exit.

I&#039;m doing this within my Delphi application and it crashes.
I run 3 procedures from the one button click and the ckeck for user is the first. If user exists it halts the program.
Is there not and IF THEN ELSE in SQL?</description>
		<content:encoded><![CDATA[<p>This is great!!!! but&#8230;..</p>
<p>What if you wanted to continue with another statement if the user existed.<br />
IF NOT EXISTS(SELECT name FROM sys.server_principals WHERE name = &#8216;test_user&#8217;)<br />
BEGIN<br />
    CREATE LOGIN test_user WITH PASSWORD = &#8216;Password123&#8242;<br />
END</p>
<p>If it does exist how can we carry on executing other statements or can we just exit.</p>
<p>I&#8217;m doing this within my Delphi application and it crashes.<br />
I run 3 procedures from the one button click and the ckeck for user is the first. If user exists it halts the program.<br />
Is there not and IF THEN ELSE in SQL?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

