December 26, 2007 at 12:52 am
Hi the SQL expert,
I want to check the vulnerability for the new server coming from development to Production. I already create the SQl script to check the vulnerability for each server. But I having problem to check the Registry value. Because if i run as per scriprt below, there are a lot values result will appear.
set nocount on
EXECUTE xp_regenumvalues 'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\MSSQLServer\SQLSERVERAGENT'
Please help me if I want onty the SYSAdminOnly value at this Registry?
Regards
🙂
December 26, 2007 at 3:01 am
One option is to put the results of the SP to a temp table and read the desired value from it.
example:
CREATE TABLE #tmp (Value NVARCHAR(200), Data NVARCHAR(500))
INSERT INTO #tmp EXECUTE xp_regenumvalues 'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\MSSQLServer\SQLSERVERAGENT'
SELECT * FROM #tmp WHERE Value = 'SysAdminOnly'
DROP TABLE #tmp
But Look at the tutorial given at : http://www.dbazine.com/sql/sql-articles/larsen11
and http://www.dbazine.com/sql/sql-articles/larsen10
.
December 27, 2007 at 2:02 am
Hi
i got the error:
Msg 515, Level 16, State 2, Server MYMSCAPP115, Line 11
Cannot insert the value NULL into column 'Data', table 'tempdb.dbo.#tmp________________________________________________________________________________________________________________00000032AA6A'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Value
Data
Pls advice
December 27, 2007 at 2:42 am
Modify the definition of the temp table
CREATE TABLE #tmp (Value NVARCHAR(200), Data NVARCHAR(500) NULL)
.
December 28, 2007 at 12:06 am
These should help...
http://www.databasejournal.com/features/mssql/article.php/1462641
http://codebetter.com/blogs/raymond.lewallen/archive/2005/09/12/131869.aspx
http://www.novicksoftware.com/UDFofWeek/Vol2/T-SQL-UDF-Vol-2-Num-41-udf_Sys_RegReadStr.htm
--Jeff Moden
Change is inevitable... Change for the better is not.
December 30, 2007 at 8:10 pm
hi jacob sebastian & Jeff Moden,
Tq for your support & advice.
If u have other scriprt like to check file system, Local Policy & Registry permission. Please advice me.
TQ
😀
December 30, 2007 at 10:03 pm
Nope... that's pretty much it...
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply