Context Is Everything - Check Your Settings

  • Comments posted to this topic are about the item Context Is Everything - Check Your Settings

  • Thank you for this William, very useful!

    😎

  • Hi,

    I can't seem to find the

    "

    There is a script attached to this article"

    Regards

  • The attachment is at the very bottom of the article. It is called Settings.sql

  • Nice article, but you just made every support call I handle twice as long. Every user that sees this will be adding SQL DBA to their resume and business card. I can see it now:

    SCENARIO: I am called to discuss sudden performance problem on an ordinarily behaving server.

    USER: I did some troubleshooting of my own and I am concerned with this thing called 'COLLATION'. I read online that 'EBCDIC' is faster.... When can we make that change?'

    SQL DBA: <groan>

  • I can only run this script from master else I get the following error.

    Msg 4104, Level 16, State 1, Line 2

    The multi-part identifier "objects.schema_id" could not be bound.

    How do I collect Database Properties from a specific database?

    I am guessing I need to edit

    insert into @s-2 select 'DatabaseProperty', 'IsAnsiNullDefault', cast(DATABASEPROPERTYEX(db_name(), 'IsAnsiNullDefault') as varchar(300)), '1', 1, 0;

    to this

    insert into @s-2 select 'DatabasePropertyTargetDB', 'IsAnsiNullDefault', cast(DATABASEPROPERTYEX('TargetDB', 'IsAnsiNullDefault') as varchar(300)), '1', 1, 0;

    and repeat this for every database I wish to monitor? That's fine as I don't have many databases to watch. Still a very useful script.

    Thanks!

  • facemann (5/6/2014)


    I can only run this script from master else I get the following error.

    Msg 4104, Level 16, State 1, Line 2

    The multi-part identifier "objects.schema_id" could not be bound.

    I wrote the script for sqlserver 2008r2 but you may replace the DROP PROCEDURE statement at the top or adapt it for other versions.

    How do I collect Database Properties from a specific database?

    I am guessing I need to edit

    insert into @s-2 select 'DatabaseProperty', 'IsAnsiNullDefault', cast(DATABASEPROPERTYEX(db_name(), 'IsAnsiNullDefault') as varchar(300)), '1', 1, 0;

    to this

    insert into @s-2 select 'DatabasePropertyTargetDB', 'IsAnsiNullDefault', cast(DATABASEPROPERTYEX('TargetDB', 'IsAnsiNullDefault') as varchar(300)), '1', 1, 0;

    and repeat this for every database I wish to monitor? That's fine as I don't have many databases to watch. Still a very useful script.

    Thanks!

    My objective was to create a custom version for each database project I support since each database may have different requirements. The db_name() function will get the current setting for the database in which the procedure is created so no edit of that is necessary. I think there is an MsForEach proc that will iterate through all databases but I'm no expert on using that.

  • Got it. Thanks Bill. 🙂

  • Thanks, Bill, definitely food for thought.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

Viewing 9 posts - 1 through 8 (of 8 total)

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