SQL Server System Report

  • That would be a good idea. Can you give me some of the output fields you'd like to be included / shown?

  • I had a friend look at and he suggested the following.

    Replace

    ,REVERSE (SUBSTRING (REVERSE (CONVERT (VARCHAR (15), CONVERT (MONEY, @@TOTAL_READ), 1)), 4, 15)) AS reads

    ,REVERSE (SUBSTRING (REVERSE (CONVERT (VARCHAR (15), CONVERT (MONEY, @@TOTAL_WRITE), 1)), 4, 15)) AS writes

    with

    ,Left(CONVERT(VARCHAR,cast(@@TOTAL_READ as money), 1), len(CONVERT(VARCHAR,cast(@@TOTAL_READ as money), 1))-3) AS reads

    ,Left(CONVERT(VARCHAR,cast(@@TOTAL_WRITE as money), 1), len(CONVERT(VARCHAR,cast(@@TOTAL_WRITE as money), 1))-3) AS writes

    I'm not that great at coding.. It worked with your and his suggestion.

    Hope this helps.

    Thank you

    JM

  • Great! Glad it worked. It's probably easier to just change the VARCHAR value, but whatever works best for you. 🙂

  • Something like this (I got from somewhere on this website):

    Maybe you can think of something alittle different, but you get the idea.

    I want to have parts Server level security and database level security.

    Let me know what you come up with.

    /***Listing Permissions

    A quick and easy script you can use to see what permissions are assigned at the server level

    is the following. It uses the sys.server_permissions catalog view joined against

    the sys.server_principals catalog view to pull back all the server-level permissions

    belonging to SQL Server logins, Windows user logins, and Windows group logins:*/

    SELECT

    [srvprin].[name] [server_principal],

    [srvprin].[type_desc] [principal_type],

    [srvperm].[permission_name],

    [srvperm].[state_desc]

    FROM [sys].[server_permissions] srvperm

    INNER JOIN [sys].[server_principals] srvprin

    ON [srvperm].[grantee_principal_id] = [srvprin].[principal_id]

    WHERE [srvprin].[type] IN ('S', 'U', 'G')

    ORDER BY [server_principal], [permission_name];

  • Perfect. I like the idea a lot. I've added it to the list and will re-post the script when it's done.

  • Sean

    Sorry it took a while to get back to you. I was running the report on SQL 2000 - I didn't realise that it it was only written for 2005. Does it work on 2008?

    You are a genius! This will be a great help to me and many others I'm sure.

    Thanks

    George25

  • I believe it should run on 2008, though I don't have a box to test it against. If you do, please let me know if it runs as expected. Thanks!

  • Sean Smith-776614 (6/26/2010)


    I believe it should run on 2008, though I don't have a box to test it against. If you do, please let me know if it runs as expected. Thanks!

    It does work on 2008. I've had if running for a few days now with no issues.

  • Fantastic! Thanks for letting me know. 🙂

  • After executing the Sp this is what i get:

    Mail queued.

    Am i missing something?

  • After executing this SP this is what i get:

    Mail queued.

    Am i missing something?

  • Yes. This is good.

    If you have the SP still open....scroll down to where it says:

    SET @vRecipients = 'amc1234@stategov.com'

    Replace it with your email address & Save.

    Then go to Master database, Programmability, Stored Procedure....

    find the SP 'usp_SSAJ_SQL_Server_System_Report ' you just created....

    Right Click on it and choose 'Execute Stored Procedure'.

    In a few seconds you will get an email with SQL Server System Report of the server you put this SP on.

    Let me know if it's working for you.

  • Oops, just look for...

    "SET @vRecipients = "

    and put YOUR email address here betwen the single quotes. Now follow the rest.

  • I followed your instructions ,but i got no email.

  • I was running on 2008.Would that mather?

Viewing 15 posts - 31 through 45 (of 189 total)

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