xp_instance_regread

  • I am running the following SQL script against my SQL Server 2008 installation:

    DECLARE @SQLErrorLogs VARCHAR(512)

    EXEC master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQLServer',N'NumErrorLogs',@SQLErrorLogs OUTPUT

    PRINT 'Number of SQL Error Logs: ' + @SQLErrorLogs

    Strangely the following output is generated:

    Number of SQL Error Logs: c

    As I had set this value to 99, I wasn't expecting 'c' as a result.

    Any ideas?

    Thanks in advance.

  • Try to create NumErrorLogs as String Value.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply