SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Ad hoc updates to system catalogs are not allowed


Ad hoc updates to system catalogs are not allowed

Author
Message
SKYBVI
SKYBVI
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1563 Visits: 3239
Hi,
I want to set the expiration policy checked in for
all the sql server logins and so I am running this query:---

EXEC sp_configure 'allow updates', 1
RECONFIGURE WITH OVERRIDE
GO
update sys.sql_logins
set is_expiration_checked ='1'
go


BUT, I am getting this error:-

Ad hoc updates to system catalogs are not allowed.

Regards,
Skybvi
John Mitchell-245523
John Mitchell-245523
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14109 Visits: 15952
You can't make direct updates to system tables from 2005 onwards. Use ALTER LOGIN instead.

See here:
http://technet.microsoft.com/en-us/library/ms189631.aspx

John
SKYBVI
SKYBVI
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1563 Visits: 3239
John Mitchell-245523 (12/1/2011)
You can't make direct updates to system tables from 2005 onwards. Use ALTER LOGIN instead.

See here:
http://technet.microsoft.com/en-us/library/ms189631.aspx

John


John, what about If i need to set the policy for all the sql logins and not just 1 like in an alter login
statement...?

Regards,
Skybvi
John Mitchell-245523
John Mitchell-245523
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14109 Visits: 15952
The only way I know for existing logins is to execute the ALTER LOGIN statements one by one. You can generate them very easily something like this (pseudo code because I haven't checked the syntax):

SELECT 'ALTER LOGIN ' + name + ' SET CHECK_EXPIRATION ON'
FROM master.sys.server_principals
WHERE IsNTLogin = 0

John
SKYBVI
SKYBVI
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1563 Visits: 3239
John Mitchell-245523 (12/1/2011)
The only way I know for existing logins is to execute the ALTER LOGIN statements one by one. You can generate them very easily something like this (pseudo code because I haven't checked the syntax):

SELECT 'ALTER LOGIN ' + name + ' SET CHECK_EXPIRATION ON'
FROM master.sys.server_principals
WHERE IsNTLogin = 0

John


What is IsNTLogin ??

Regards,
Skybvi
John Mitchell-245523
John Mitchell-245523
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14109 Visits: 15952
Like I said, it's pseudo code, so you'll need to check the exact syntax of ALTER LOGIN and the structure of server_principals to see what the column names and the values in them are. It's just saying put a WHERE clause on so that you're not trying to set the expiration check for Windows logins.

John
SKYBVI
SKYBVI
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1563 Visits: 3239
John Mitchell-245523 (12/1/2011)
Like I said, it's pseudo code, so you'll need to check the exact syntax of ALTER LOGIN and the structure of server_principals to see what the column names and the values in them are. It's just saying put a WHERE clause on so that you're not trying to set the expiration check for Windows logins.

John


I guess ( not sure) though that if i use sys.sql_logins, the logins will be of sql only and not of windows logins..
So is it that I can use sys.sql_logins ?

Regards,
Skybvi
John Mitchell-245523
John Mitchell-245523
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14109 Visits: 15952
Yes, I don't see why that shouldn't work.

John
SKYBVI
SKYBVI
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1563 Visits: 3239
John Mitchell-245523 (12/2/2011)
Yes, I don't see why that shouldn't work.

John


Cool
thanks a lot

Regards,
Skybvi
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search