Forum Replies Created

Viewing 15 posts - 1,096 through 1,110 (of 7,613 total)

  • Reply To: Enclosure

    Within other quotes, you have to double up the single quotes around the date, like so:

    SET @Where = @Where + ' T0.U_DATE BETWEEN ''20210301'' and ''20210331'' '

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: clustered index usage

    For doing single row lookups, a nonclustered index (NI) on a heap is no worse performance than a clustered index (CI).  However, as Grant noted, SQL does truly prefer CIs.

    If...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Extract certain string before a particular string

    IF you want to extract the value after 'number="' in the string:

    SELECT *,
    SUBSTRING(string, NULLIF(CHARINDEX('number="', string), 0) + 8,
    ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Grouping by hour and minute from TimeStamped data

    No sample data, so unable to test.  You might have to include DATENAME(WEEKDAY, CA1.[Start Time]) in the GROUP BY, but I don't think that's required.  I can't remember for sure...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    Michael L John wrote:

    ScottPletcher wrote:

    frederico_fonseca wrote:

    ScottPletcher wrote:

    Jeff Moden wrote:

    ScottPletcher wrote:

    "I review it".  How long does THAT take?

    And why does it need reviewed for "safety" if they don't have the permissions to change anything...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    Ed Wagner wrote:

    frederico_fonseca wrote:

    ScottPletcher wrote:

    Jeff Moden wrote:

    ScottPletcher wrote:

    "I review it".  How long does THAT take?

    And why does it need reviewed for "safety" if they don't have the permissions to change anything on...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    frederico_fonseca wrote:

    ScottPletcher wrote:

    Jeff Moden wrote:

    ScottPletcher wrote:

    "I review it".  How long does THAT take?

    And why does it need reviewed for "safety" if they don't have the permissions to change anything on the...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    Jeff Moden wrote:

    ScottPletcher wrote:

    "I review it".  How long does THAT take?

    And why does it need reviewed for "safety" if they don't have the permissions to change anything on the instance??

    What on...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    Jeff Moden wrote:

    ScottPletcher wrote:

    frederico_fonseca wrote:

    ScottPletcher wrote:

    Hold on.  I explicitly stated that auditors should not be able to change anything on the system.  Talking about giving auditors "sysadmin" is a straw man.

    Scripts that...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    frederico_fonseca wrote:

    ScottPletcher wrote:

    Hold on.  I explicitly stated that auditors should not be able to change anything on the system.  Talking about giving auditors "sysadmin" is a straw man.

    Scripts that capture full...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    frederico_fonseca wrote:

    ScottPletcher wrote:

    Hold on.  I explicitly stated that auditors should not be able to change anything on the system.  Talking about giving auditors "sysadmin" is a straw man.

    Scripts that capture full...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: T-SQL Error: Msg 102, Level 15, State 1, Line 4 Incorrect syntax near '('.

    One of the annoying things about the $(ESCAPE macros is that they are recognized only in job code (at least the last time I checked this).

    So you'll have to run...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    Jeff Moden wrote:

    ScottPletcher wrote:

    An "audit" that only allows what the DBA wants to run is not a true audit.

    Correct.  That's why I have them witness the runs.  And, as a...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    frederico_fonseca wrote:

    ScottPletcher wrote:

    And in neither case did all inquiries go thru and be approved by the DBA, correct?

    An "audit" that only allows what the DBA wants to run is...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: permissions

    Michael L John wrote:

    Jeff Moden wrote:

    ScottPletcher wrote:

    Jeff Moden wrote:

    ScottPletcher wrote:

    Jeff Moden wrote:

    frederico_fonseca wrote:

    why do other uses need to see who can login on a server? that is on its own a security risk and should...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 1,096 through 1,110 (of 7,613 total)