Re: SA account
- From: "Dan Guzman" <guzmanda@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 17 May 2009 11:55:39 -0500
That is, no semicolon after END TRY. (On the other hand, if you want
semicolons in every possible place, I think you should have one after
BEGIN TRY and also BEGIN CATCH.)
Thanks for the correct, Erland. I didn't intend to include the semicolon after the END TRY.
--
Hope this helps.
Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
"Erland Sommarskog" <esquel@xxxxxxxxxxxxx> wrote in message news:Xns9C0EBCB39548Yazorman@xxxxxxxxxxxx
Dan Guzman (guzmanda@xxxxxxxxxxxxxxxxxxxxxxxxxxx) writes:I appreciate if you provide me with a query that verifies that SA account
has no blank password.
BEGIN TRAN;
BEGIN TRY
ALTER LOGIN sa
WITH PASSWORD = 'st0ongp@assw0rd'
OLD_PASSWORD = '';
PRINT 'sa password is blank';
END TRY;
BEGIN CATCH
IF ERROR_NUMBER() <> 15151
PRINT ERROR_MESSAGE();
END CATCH;
ROLLBACK;
Small correction:
BEGIN TRAN;
BEGIN TRY
ALTER LOGIN sa
WITH PASSWORD = 'st0ongp@assw0rd'
OLD_PASSWORD = '';
PRINT 'sa password is blank';
END TRY
BEGIN CATCH
IF ERROR_NUMBER() <> 15151
PRINT ERROR_MESSAGE();
END CATCH;
ROLLBACK;
That is, no semicolon after END TRY. (On the other hand, if you want
semicolons in every possible place, I think you should have one after
BEGIN TRY and also BEGIN CATCH.)
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- SA account
- From: Yousef Alsayed
- Re: SA account
- From: Dan Guzman
- Re: SA account
- From: Erland Sommarskog
- SA account
- Prev by Date: Re: SA account
- Next by Date: Application Role Password
- Previous by thread: Re: SA account
- Next by thread: RE: SA account
- Index(es):
Relevant Pages
|