Forum Replies Created

Viewing 15 posts - 4,276 through 4,290 (of 7,613 total)

  • RE: Interview Questions

    My advanced knowledge, "tricky" q is:

    In autocommit mode, when can an UPDATE statement partially complete, some UPDATEs made, some not, where SQL does not roll it back?

    Edit: And...

    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: Is it possible to incrementally increase a number value at the end of a varchar string?

    Maybe this:

    insert into #mailing

    (segment

    ,contact_number)

    select @mailing + RIGHT('0' + CAST(base_value + row_num AS varchar(2)), 2)

    ,AccountNumber

    from (

    select distinct AccountNumber, ROW_NUMBER() over(order by AccountNumber) as row_num

    ...

    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: Merge Multiple Columns in to One

    I'd make a slight adjustment, since I prefer to check conditions as near to the source as possible, and it might even be slightly more efficient:

    SELECT X1,

    ...

    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: Interview Questions

    Eric M Russell (6/9/2016)


    Sean Lange (6/9/2016)


    Eric M Russell (6/9/2016)


    patrickmcginnis59 10839 (6/9/2016)


    Eric M Russell (6/7/2016)


    Luis Cazares (6/7/2016)


    Was I too late for April fools' day?

    This is what happens when you trust 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".

  • RE: Interview Questions

    GSquared (6/9/2016)


    Sean Lange (6/7/2016)


    Jeff Moden (6/7/2016)


    Eric M Russell (6/7/2016)


    They're asking the wrong type of questions for a job interview.

    I think it's a great question. It shows whether or not...

    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: Querying single table suddenly running slowly

    SQL Server has built-in performance reports that could help you here.

    Using SSMS, for the instance that contains the db having the problem:

    1) right-click on the instance name

    2) select "Reports"

    3) select...

    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 design question

    With just a quick look, I'd do something like below. I tried to follow your naming style, naturally change as needed.

    Since we can't guarantee unique ProductNumbers across companies, we'll...

    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 Design Follies: NULL vs. NOT NULL

    Dennis Q Miller (6/1/2016)


    Stacey Decker (10/30/2014)


    I agree, why allow two values to mean the same thing? I handle this by allowing optional fields such as AddressLine2 to be NULL and...

    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: Recreating tables from a list of tables

    The best clustered index is almost always the single most critical performance factor for a table. You could gain some mild efficiencies looking at other things, but a far,...

    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: Recreating tables from a list of tables

    cyp901 (5/31/2016)


    Andre 425568 (5/26/2016)


    I got fragmentation stats after the Table rebuild and then after index rebuild. Still had a lot of fragmentation.

    I believe what Jeff Moden was trying to say...

    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: Inline Table Functions with IF or Case Statement

    You can use derived tables within the query to provide computed values, you don't need variables.

    Also, here's a quick demo to show that you can query from different tables, 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: Inline Table Functions with IF or Case Statement

    djj (5/26/2016)


    ScottPletcher (5/26/2016)


    If the table structures to be returned are the same for all conditions, you can use UNION ALL with the appropriate WHERE conditions so that only one query...

    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 identifying dates of an occurance after a specific date

    For up to 3 accidents total, it's relatively straightforward, with a single table pass for each table -- afaik, beyond 3 would require additional code/complexity (at least one additional join/select...

    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 Date column issues in query

    You SET @startdate twice instead of setting @enddate 🙂

    ..

    set @startdate = '01-01-2016'

    declare @enddate datetime

    set @startdate = '10-10-2016' --should be set @enddate = ...

    ...

    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: Inline Table Functions with IF or Case Statement

    If the table structures to be returned are the same for all conditions, you can use UNION ALL with the appropriate WHERE conditions so that only one query ever returns...

    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,276 through 4,290 (of 7,613 total)