Are the posted questions getting worse?

  • Steve Jones - SSC Editor (4/15/2016)


    About to head off to SQL Saturday Phoenix. Anyone else going?

    Wouldn't mind to go even if it was only for the 20-30C

    😎

    BTW when you come over for the Bits, bring warm clothes, someone forgot to tell the weather that it's spring now.

  • Eirikur Eiriksson (4/15/2016)


    jeff.mason (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    Phil Parkin (4/15/2016)


    Anyone have a crystal ball, several hours to kill and feeling masochistic? Dive in!

    Quick fix in three steps

    1. Drop procedure

    2. Drop developer

    3. Create developer

    😎

    Do 2 and 3 in one step as an IF EXISTS. In this case the IF clause will fail and it will be able to create the developer.

    You are absolutely right, thank you for the correction πŸ˜€

    😎

    USE MyWorkplace;

    GO

    IF (SELECT Name FROM sys.objects

    WHERE Name = ProcName) IS NOT NULL

    DROP DATABASE MyWorkPlace;

    IF (SELECT Name FROM sys.server_principals

    WHERE Name = 'Developer') IS NOT NULL

    BEGIN

    DELETE FROM sys.server_principals

    WHERE Name = 'Developer';

    DELETE FROM HR.Paperwork

    WHERE Name = 'Developer';

    DELETE FROM Building.Security

    WHERE Name = 'Developer';

    DROP ENTITY Developer;

    END

    IF (SELECT Name FROM sys.server_principals

    WHERE Name = 'Developer') IS NULL

    CREATE ENTITY Developer

    (DeveloperName VARCHAR(100),

    Intelligence INT,

    Curiosity INT,

    SQLSkills BIT CONSTRAINT DF_HasSQLSkills DEFAULT 1,

    --DBA NOTE to HR: where 1 is True and 0 is False

    MadCodingSkillz CONSTRAINT DF_Is733T DEFAULT 1,

    GeekCreds INT);

    [/code]

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Lynn Pettis (4/15/2016)


    Let's back door the DBA.

    Innocent or not, that would quickly get someone fired at my workplace. Escorted out without notice, etc.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Steve Jones - SSC Editor (4/15/2016)


    About to head off to SQL Saturday Phoenix. Anyone else going?

    See ya there.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Brandie Tarvin (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    jeff.mason (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    Phil Parkin (4/15/2016)


    Anyone have a crystal ball, several hours to kill and feeling masochistic? Dive in!

    Quick fix in three steps

    1. Drop procedure

    2. Drop developer

    3. Create developer

    😎

    Do 2 and 3 in one step as an IF EXISTS. In this case the IF clause will fail and it will be able to create the developer.

    You are absolutely right, thank you for the correction πŸ˜€

    😎

    USE MyWorkplace;

    GO

    IF (SELECT Name FROM sys.objects

    WHERE Name = ProcName) IS NOT NULL

    DROP DATABASE MyWorkPlace;

    IF (SELECT Name FROM sys.server_principals

    WHERE Name = 'Developer') IS NOT NULL

    BEGIN

    DELETE FROM sys.server_principals

    WHERE Name = 'Developer';

    DELETE FROM HR.Paperwork

    WHERE Name = 'Developer';

    DELETE FROM Building.Security

    WHERE Name = 'Developer';

    DROP ENTITY Developer;

    END

    IF (SELECT Name FROM sys.server_principals

    WHERE Name = 'Developer') IS NULL

    CREATE ENTITY Developer

    (DeveloperName VARCHAR(100),

    Intelligence INT,

    Curiosity INT,

    SQLSkills BIT CONSTRAINT DF_HasSQLSkills DEFAULT 1,

    --DBA NOTE to HR: where 1 is True and 0 is False

    MadCodingSkillz CONSTRAINT DF_Is733T DEFAULT 1,

    GeekCreds INT);

    [/code]

    Make Intelligence and Curiosity tinyint or add a CHECK to avoid negative values.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Brandie Tarvin (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    jeff.mason (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    Phil Parkin (4/15/2016)


    Anyone have a crystal ball, several hours to kill and feeling masochistic? Dive in!

    Quick fix in three steps

    1. Drop procedure

    2. Drop developer

    3. Create developer

    😎

    Do 2 and 3 in one step as an IF EXISTS. In this case the IF clause will fail and it will be able to create the developer.

    You are absolutely right, thank you for the correction πŸ˜€

    😎

    USE MyWorkplace;

    GO

    IF (SELECT Name FROM sys.objects

    WHERE Name = ProcName) IS NOT NULL

    DROP DATABASE MyWorkPlace;

    IF (SELECT Name FROM sys.server_principals

    WHERE Name = 'Developer') IS NOT NULL

    BEGIN

    DELETE FROM sys.server_principals

    WHERE Name = 'Developer';

    DELETE FROM HR.Paperwork

    WHERE Name = 'Developer';

    DELETE FROM Building.Security

    WHERE Name = 'Developer';

    DROP ENTITY Developer;

    END

    IF (SELECT Name FROM sys.server_principals

    WHERE Name = 'Developer') IS NULL

    CREATE ENTITY Developer

    (DeveloperName VARCHAR(100),

    Intelligence INT,

    Curiosity INT,

    SQLSkills BIT CONSTRAINT DF_HasSQLSkills DEFAULT 1,

    --DBA NOTE to HR: where 1 is True and 0 is False

    MadCodingSkillz CONSTRAINT DF_Is733T DEFAULT 1,

    GeekCreds INT);

    [/code]

    Further on Luis's good advice, change

    USE MyWorkplace;

    GO

    to

    USE master;

    GO

    otherwise you'll get the error

    Msg 3702, Level 16, State 3, Line 6

    Cannot drop database "MyWorkplace" because it is currently in use.

    😎

  • SQLRNNR (4/15/2016)


    Steve Jones - SSC Editor (4/15/2016)


    About to head off to SQL Saturday Phoenix. Anyone else going?

    See ya there.

    ditto

  • Eirikur Eiriksson (4/15/2016)


    Steve Jones - SSC Editor (4/15/2016)


    About to head off to SQL Saturday Phoenix. Anyone else going?

    Wouldn't mind to go even if it was only for the 20-30C

    😎

    BTW when you come over for the Bits, bring warm clothes, someone forgot to tell the weather that it's spring now.

    Not sure what to pack. It's warm in the Valley of the Sun, but supposed to be a blizzard in Denver tomorrow. I return late Sat, so leaving a ski coat in the car.

  • Steve Jones - SSC Editor (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    Steve Jones - SSC Editor (4/15/2016)


    About to head off to SQL Saturday Phoenix. Anyone else going?

    Wouldn't mind to go even if it was only for the 20-30C

    😎

    BTW when you come over for the Bits, bring warm clothes, someone forgot to tell the weather that it's spring now.

    Not sure what to pack. It's warm in the Valley of the Sun, but supposed to be a blizzard in Denver tomorrow. I return late Sat, so leaving a ski coat in the car.

    I'm only down the road from SQL Bits and we've got snow forecast for overnight. Admittedly it's only going to be a light dusting but it's April!


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    β€”Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Greg Edwards-268690 (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    jeff.mason (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    Phil Parkin (4/15/2016)


    Anyone have a crystal ball, several hours to kill and feeling masochistic? Dive in!

    Quick fix in three steps

    1. Drop procedure

    2. Drop developer

    3. Create developer

    😎

    Do 2 and 3 in one step as an IF EXISTS. In this case the IF clause will fail and it will be able to create the developer.

    You are absolutely right, thank you for the correction πŸ˜€

    😎

    I can see a much better execution plan being generated already.

    I like how the OP in that thread had no execution plan due to limitations, but there were no issues with it. :w00t:

  • Greg Edwards-268690 (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    jeff.mason (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    Phil Parkin (4/15/2016)


    Anyone have a crystal ball, several hours to kill and feeling masochistic? Dive in!

    Quick fix in three steps

    1. Drop procedure

    2. Drop developer

    3. Create developer

    😎

    Do 2 and 3 in one step as an IF EXISTS. In this case the IF clause will fail and it will be able to create the developer.

    You are absolutely right, thank you for the correction πŸ˜€

    😎

    I can see a much better execution plan being generated already.

    At least now we have a "Plan"

    😎

  • Ed Wagner (4/15/2016)


    Greg Edwards-268690 (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    jeff.mason (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    Phil Parkin (4/15/2016)


    Anyone have a crystal ball, several hours to kill and feeling masochistic? Dive in!

    Quick fix in three steps

    1. Drop procedure

    2. Drop developer

    3. Create developer

    😎

    Do 2 and 3 in one step as an IF EXISTS. In this case the IF clause will fail and it will be able to create the developer.

    You are absolutely right, thank you for the correction πŸ˜€

    😎

    I can see a much better execution plan being generated already.

    I like how the OP in that thread had no execution plan due to limitations, but there were no issues with it. :w00t:

    Just another PICNIC

    😎

  • Eirikur Eiriksson (4/15/2016)


    Ed Wagner (4/15/2016)


    Greg Edwards-268690 (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    jeff.mason (4/15/2016)


    Eirikur Eiriksson (4/15/2016)


    Phil Parkin (4/15/2016)


    Anyone have a crystal ball, several hours to kill and feeling masochistic? Dive in!

    Quick fix in three steps

    1. Drop procedure

    2. Drop developer

    3. Create developer

    😎

    Do 2 and 3 in one step as an IF EXISTS. In this case the IF clause will fail and it will be able to create the developer.

    You are absolutely right, thank you for the correction πŸ˜€

    😎

    I can see a much better execution plan being generated already.

    I like how the OP in that thread had no execution plan due to limitations, but there were no issues with it. :w00t:

    Just another PICNIC

    😎

    hehe I like that better than mine. I have always called that a PEBKAC - Problem exists between keyboard and chair.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Phil Parkin (4/15/2016)


    Anyone have a crystal ball, several hours to kill and feeling masochistic? Dive in!

    I'm going to have to steal "Don't have a clue how to optimize this due to some limitations"

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (4/15/2016)


    Phil Parkin (4/15/2016)


    Anyone have a crystal ball, several hours to kill and feeling masochistic? Dive in!

    I'm going to have to steal "Don't have a clue how to optimize this due to some limitations"

    I'm going to try that 'limitations' ruse on upper management here. Wish me luck.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 15 posts - 53,581 through 53,595 (of 66,749 total)

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