Forum Replies Created

Viewing 15 posts - 4,996 through 5,010 (of 10,144 total)

  • RE: Performance Problem In a Procedure

    The single biggest cost is a function which references a view which references a function which unnecessarily uses a slow cursor to concatenate some columns. Or something similar. A half...

  • RE: multiple a number with time dataType

    vahid.arr (3/22/2013)


    i want to minus two time(time(7) datattype in sql 2008) datatype and multiple(hour and minute) it to 30.how can i do that?this just work for hour

    SELECT datediff(HOUR,[EnterTime],[ExitTime] )*30 from...

  • RE: Are the posted questions getting worse?

    Evil Kraig F (3/21/2013)


    I am well aware of the bad contractors out there... I'm a contractor myself. I've actually called back to the home company and told them to...

  • RE: Join yeilds different results if used with CTE or a real table

    It's down to an optimisation introduced in SQL Server2005 often called "Deferred expression evaluation". Here's a great article by Paul White to add to others already posted.

    The original "failing" query...

  • RE: Insert duplicate rows based on number in the column

    knakka 14475 (3/21/2013)


    Hi ChrisM@Work thank you for the reply.. I have one question in case they are more than 100 quanties what do I need to do.

    ;WITH

    -- Make an inline...

  • RE: Insert duplicate rows based on number in the column

    Declare @OrigTab Table(Part varchar(30), qty int)

    insert into @OrigTab

    select 'X51','3' union

    select 'A5','1' union

    select '123','2' union

    select '054','5'

    select * from @OrigTab ORDER BY 1 DESC

    ;WITH

    -- Make an inline tally table (CTE)

    E1(N) AS...

  • RE: Are the posted questions getting worse?

    Stefan Krzywicki (3/21/2013)


    L' Eomot Inversé (3/21/2013)


    dwain.c (3/20/2013)


    Lynn Pettis (3/20/2013)


    I am really wondering how some people manage to get into contracting when they have no idea how to write good, performing...

  • RE: Bushy plan vs left-deep

    karthik M (3/21/2013)


    I have read about Bushy plan and left deep in some articles. Bushy plan will consume more memory as it runs parallely. is it advisable to write query...

  • RE: Table Join using unique values or where Null = all values

    The spec isn't entirely clear; does this generate the results you're expecting to see?

    SELECT b.*, a.*, x.*

    FROM TableB b

    LEFT JOIN TableA a ON b.ColId = a.Area

    LEFT JOIN TableA x...

  • RE: CAST CONVERT doesn't work

    DECLARE @SomeDate CHAR(8) = '0'

    SELECT

    ISDATE(@SomeDate),

    CAST(NULLIF(@SomeDate,'0') AS DATE)

    -- similar to this handy trick:

    DECLARE @numerator INT = 1, @denominator INT = 0

    SELECT @numerator/@denominator

    --Msg 8134, Level 16, State 1, Line 3

    --Divide...

  • RE: Insertion in table

    homebrew01 (3/19/2013)


    Chris, although your code is better, I can understand why it's confusing to newer SQL coders. I think it's less intuitive, and not everyone is familiar with some of...

  • RE: Deadlock on update command

    bugg (3/20/2013)


    ChrisM@Work (3/20/2013)


    Add column [status] to the include list for index IX_sessionid.

    As an aside, you appear to have a fair amount of duplication in your indexes.

    Thanks for that suggestion.

    The...

  • RE: best optimized query for the requirement

    Jeff Moden (3/20/2013)


    Shanmuga Raj (3/20/2013)


    Thanks.. its working !

    can you let me know why you have used

    HAVING COUNT(*) = 4

    That's to make it so that only those product_ids that...

  • RE: Deadlock on update command

    Add column [status] to the include list for index IX_sessionid.

    As an aside, you appear to have a fair amount of duplication in your indexes.

  • RE: best optimized query for the requirement

    Shanmuga Raj (3/20/2013)


    when i run the below query i get error

    Conversion failed when converting the varchar value ' | | |0|0|0' to data type int.

    ...

    Ah, that's because I used...

Viewing 15 posts - 4,996 through 5,010 (of 10,144 total)