Forum Replies Created

Viewing 15 posts - 6,181 through 6,195 (of 7,613 total)

  • RE: Copy DB from Prod to QA

    Yes, restore the qa db from a production backup. Create a script that does that, including all the appropriate "WITH MOVE ... TO ..., MOVE ... TO ..." clauses.

    But...

    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: GUID Pirmary key

    andrew gothard (3/29/2014)


    Simple arithmetic, if you have 8k pages, one row per page (and we know that it's going to be bigger than that), 12500 rows. Table Lock (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".

  • RE: Sql help

    Ignoring any potential performance issues, a CROSS APPLY can do what you want fairly easily. Simply indexing the table properly can often deal with that. Or you can...

    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: Most Updated Records from Multiple Join Query

    SELECT

    COALESCE(a.ID, b.ID) AS ID,

    COALESCE(a.NAME, b.NAME) AS NAME,

    CASE WHEN a.UpdateDate > b.UpdateDate THEN a.UpdateDate ELSE b.UpdateDate 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: GUID Pirmary key

    andrew gothard (3/27/2014)


    ScottPletcher (3/27/2014)


    andrew gothard (3/27/2014)


    ScottPletcher (3/27/2014)


    yuvipoy (3/27/2014)


    Sean Lange (3/27/2014)


    True. I have worked with this OP on several threads and the problem is performance because they have several related tables...

    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 runaway query using multiple APPLY joins

    I think you can simplify the query something like below, although some tweaking might need done:

    SELECT

    s.state_name,

    derived.NumOfDupPermits, derived.AmendedDups, derived.DistinctPermits

    FROM (

    ...

    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: GUID Pirmary key

    andrew gothard (3/27/2014)


    ScottPletcher (3/27/2014)


    yuvipoy (3/27/2014)


    Sean Lange (3/27/2014)


    True. I have worked with this OP on several threads and the problem is performance because they have several related tables and the primary...

    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: Restore compressed backup creates 5x larger database

    I restore the backup to my UAT server and the initial data size explodes to 53gb and the log is set to 1gb.

    Hmm, I think the log file 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".

  • RE: GUID Pirmary key

    yuvipoy (3/27/2014)


    Sean Lange (3/27/2014)


    True. I have worked with this OP on several threads and the problem is performance because they have several related tables and the primary key (and clustered...

    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: Adding dummy values

    I think you're looking for LEFT OUTER JOIN, something like this:

    SELECT

    c.CaseID, c.Resolution,

    COALESCE(CAST(s.CaseID AS varchar(10)), 'DUMMY-' + c.Resolution) AS SubCaseID

    ...

    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: Specific Sprocs vs general get all sprocs

    I don't see any need for a pre-built proc for:

    Get All of Foo

    Just SELECT the columns you need from the table instead.

    For the rest, if you're willing to use dynamic...

    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 is full for Large Table Joins

    Based on the query plan, I think two these things 100% need done and should help:

    1)

    Table: SubOrderTrans

    Index: idx_subordertransday

    INCLUDE column SubOrderTransDeleted in that index

    2)

    Table: SUBORDER_ETA_CORRECTIONS

    Index: IDX_NC_SubOrderID

    Change it to a clustered index,...

    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: Retrieve last 7 days date question

    Current query is not SARGable and is somewhat convoluted as well.

    SELECT DISTINCT TOP 7

    Convert(DateTime, Datediff(Day, 0, DateCreated)) AS DateCreated,

    Datepart(dw,DateCreated) AS WeekNum...

    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 is full for Large Table Joins

    Grant Fritchey (3/25/2014)


    ScottPletcher (3/25/2014)


    Grant Fritchey (3/25/2014)


    ScottPletcher (3/25/2014)


    Grant Fritchey (3/25/2014)


    I can't see the query since it exceeds the size of what's stored in the plan, so suggestions from the plan alone...

    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: Working with stored text file in TSQL

    Roughly like below. You may have to adjust the "SINGLE_NCLOB" to "SINGLE_CLOB", depending on the format of the input file.

    DECLARE @file_text varchar(max)

    SELECT @file_text = file_text

    FROM OPENROWSET(BULK 'd:\full\path\to\file\filename.txt', SINGLE_NCLOB) 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".

Viewing 15 posts - 6,181 through 6,195 (of 7,613 total)