Forum Replies Created

Viewing 15 posts - 4,711 through 4,725 (of 7,619 total)

  • RE: Whether the full backup includes log backup?

    Just to clarify, a database backup does not fully back up the log. It gets only the active portion of the log necessary to bring that full backup to...

    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".

  • RE: Trigger and email notification

    Assuming the login doing the table mod has authority to run sp_send_dbmail, it should work. If not, you might need to look at additional permissions or using EXECUTE 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".

  • RE: Need help with a query that returns only rows that meet specific condition

    SELECT UniqID

    FROM #SampleData

    GROUP BY UniqID

    HAVING MIN(Code) = 'ABC' AND MAX(Code) = 'ABC'

    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".

  • RE: Tempdb Spill level1

    As additional background, SQL estimates the memory it will need to do the sort ahead of time, based on its estimated row count and row size. If you end...

    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".

  • RE: Query on a large database

    As has been noted, the tables are definitely wrongly clustered, and that is causing the bad performance. Because, as has also been noted, of the "junior error" of assuming...

    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".

  • RE: Foreign Keys

    Or this:

    SELECT

    OBJECT_NAME(fkc.parent_object_id) AS [Referencing Table],

    fkc.parent_object_id AS [Referencing Object ID],

    OBJECT_NAME(fkc.referenced_object_id) AS [Referenced Table Name],

    fkc.referenced_object_id...

    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".

  • RE: Speed up following query (Second opinion needed)

    Maybe as below? I think you've overly complicated the date selection and caused the duplicates.

    For best performance, the Diskspace_Global table should probably be clustered either on Date_ (with 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".

  • RE: CASE Statement with Date

    First, create a "standard" tally table (a table of sequential numbers). I can't provide code because the filter thinks it's "sql injection". After creating the tally table, then...

    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".

  • RE: need help on design of database for student registration system

    hlsc1983 (10/19/2015)


    hi am back after a long time . so sorry for that. Now i need to enter 'Marks ' . Each student will have two types of marks for...

    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".

  • RE: converting inline query into Join

    I think I understand. You can get all the collectors from a single query, but you have to include the collector in a GROUP BY:

    SELECT Collector, COUNT(DISTINCT LoanID) 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".

  • RE: Database page Could not be processed?

    Script out that index first so you can easily re-create it later if you need to. The index definition itself could still be OK.

    That's actually a "good error", in...

    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".

  • RE: Allow null on data type money?

    Absolutely. If a NULL means 0, then actually put 0, not NULL. NULL is ambiguous, zero is not. If you compress the row, either value won't take...

    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".

  • RE: Allow null on data type money?

    I would allow NULLs if it's possible a value won't be known. Sometimes unknown is not the same as zero. For example, I might not know the sales...

    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".

  • RE: Creating an automated process

    You don't need MERGE, use UPDATE instead:

    UPDATE tt1

    SET DealershipName = TT2.[DealershipName],

    DealershipAddress = TT2.[DealershipAddress]

    FROM TEST_TABLE1 tt1

    INNER JOIN TEST_TABLE2 tt2 ON TT2.DealershipCode = TT1.DealershipCode;

    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".

  • RE: Getting an object name from within it's own code

    Rather than a dynamic trigger, you need dynamic code that generates a static trigger.

    That is, after the table is created, run code that dynamically analyzes that table definition and generates...

    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 - 4,711 through 4,725 (of 7,619 total)