Forum Replies Created

Viewing 15 posts - 1,396 through 1,410 (of 7,619 total)

  • Reply To: Table Size out of control..

    ScottPletcher wrote:

    Budd wrote:

    Phil - Correct.  Devs want it all in dev.

    Ken - AWESOME  "INSTEAD OF"  Why didn't I think of that.  Is a trigger to delete  ##  history table records...

    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: Table Size out of control..

    Budd wrote:

    Phil - Correct.  Devs want it all in dev.

    Ken - AWESOME  "INSTEAD OF"  Why didn't I think of that.  Is a trigger to delete  ##  history table records WHEN...

    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: datetime column, Day of Week with count, how to add month/yr grouping

    That's from the ROLLUP.

    The one with NULL, NULL is the global dayname total, so all Mondays, Tuesdays, etc., regardless of year, month.

    The one with NULL, YEAR is supposed to be...

    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: SQL Server Agent Jobs are not logging history

    Well, you fixed it, but glad I helped in some way :-).

    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: SQL Server Agent Jobs are not logging history

    Is your msdb data or log file full?

    Do you see any errors in the SQL error log that could be related to the issue?

    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: Table Size out of control..

    Agree with Ken.  Use a trigger to only write the data you want in the table to begin with.

    The only thing Ken left out was a:

    SET NOCOUNT ON

    at the start...

    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: datetime column, Day of Week with count, how to add month/yr grouping

    You didn't provide any sample data, so I can't test my code, but something like this should do what you need:

    SELECT COUNT(*) AS DayCount

    ,YEAR(myDateTime) AS Year
    ,MONTH(myDateTime) AS...

    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: Access

    When you create the proc, you would need to specify EXEC AS OWNER, making sure the OWNER is a high-level user.

    When you just give permission to EXEC the proc, 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: Dashes in uniqueidentifier

    Yes.  The format is fixed, with the dashes always in the same locations.

    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: Best Index Choices

    Sergiy wrote:

    ScottPletcher wrote:

    I suggest creating the following indexes to support the query.  If you'd like to adjust other indexes on the tables also, just let me know.

    CREATE...

    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: Best Index Choices

    If you can, review the query plan to verify that those indexes are actually being used.  Without a query plan, we can't tell 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: Best Index Choices

    Jackie Lowery wrote:

    ScottPletcher wrote:

    I suggest creating the following indexes to support the query.  If you'd like to adjust other indexes on the tables also, just let me know.

    CREATE...

    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: Best Index Choices

    I suggest creating the following indexes to support the query.  If you'd like to adjust other indexes on the tables also, just let me know.

    CREATE UNIQUE NONCLUSTERED...

    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: Sudden Duplicate rows

    One of the tables you're joining to must have an extra matching row in it compared to what you were used to seeing.  I can't tell which one from what...

    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: Find gaps in string values within a table

    Would you give us actual table data -- i.e. CREATE TABLE and INSERT statement with VALUES -- rather than just a picture?  We can't write SQL against a picture :-).

    This...

    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,396 through 1,410 (of 7,619 total)