Forum Replies Created

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

  • RE: Interview Questions

    Sean Lange (6/14/2016)


    ScottPletcher (6/14/2016)


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

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

  • 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

    ...

  • 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,

    ...

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

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

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

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

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

  • 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,...

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

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

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

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

  • 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 = ...

    ...

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