Forum Replies Created

Viewing 15 posts - 1,726 through 1,740 (of 6,036 total)

  • RE: the use of CTEs

    John Mitchell-245523 (1/6/2016)


    Should the language be kept in a glass case and never added to or enhanced?

    We're not talking about any enhancement here.

    As i said, every task which can be...

  • RE: Splitting out a row into multiple rows.

    You probably need to make sure you do not take N=0 record from Tally, if it's present there

    AND t.Number > 0

  • RE: the use of CTEs

    The fact is - CTE is a foreign construction in SQL.

    It was copied to T-SQL from front end languages to create more comfortable environment for those ".Net developers with SQL...

  • RE: the use of CTEs

    Martin,

    I honestly cannot see how a CTE can provide any better visibility than the verification SELECT I use.

    Not to forget - updating CTE is not the same as updating table....

  • RE: the use of CTEs

    Alan.B (1/5/2016)[hrWhat I was demonstrating was in response to the OP's original question and is why someone would use a CTE instead of doing a direct update... especially when the...

  • RE: the use of CTEs

    GilaMonster (12/24/2015)


    They're very useful when writing complex queries. Write a basic query, turn it into a CTE, write the next query off that, etc. Easier debugging too

    Yeah, right!

    Especially when you...

  • RE: Loop through an IN() clause?

    You do not need all those CTE's.

    This simple query will do:

    DECLARE @PartID_List VARCHAR(8000)

    SET @PartID_List = '1,2,3,4,5,6,7,8,9,10,11,12'

    SELECT pl.partDisplayName, pl.testerName, ce.testerId, partId as testId, 0 as resultCount, 'no implementation' as testStatus

    FROM dbo.catalogEntries...

  • RE: Calculate future dates which excludes weekends and holidays for few columns

    azawan (1/5/2016)


    Then it will take Future3 date column and add 2 weeks which exclude weekends & holidays to update future4 Date

    What does it really mean?

    14 working days? Why do...

  • RE: Possible to insert unaffected by rollback?

    Eirikur Eiriksson (12/27/2015)


    if you need functionality outside the ACID then use Jeff's suggestion and output the log to a file,

    While I totally agree with a file approach I must...

  • RE: Tables Design and store proc transfer For Data

    Tallboy (12/23/2015)


    But for Tally table3 where I need 2 weeks apart (known as a fortnight here) the DATEADD function does not do 2 weeks so I opted for

    DECLARE @dt1 Datetime='2015-06-15'

    DECLARE...

  • RE: Tables Design and store proc transfer For Data

    Tallboy (12/24/2015)


    Hi SSCarpal,

    I love CTE they make perfect sense to me and I have all of my sp done that way already...so there's no going back...

    But thanks for commenting...

  • RE: How to reduce Huge Log File size

    Jeff Moden (12/21/2015)


    ScottPletcher (12/21/2015)


    Yeah, everybody always "warns" about that, but who on earth would want to apply a 299GB log anyway??

    Obviously and especially in this case, it wouldn't. The...

  • RE: Database Design Question

    Comments may be added more than once, by different users in different times.

    Adding a new comment does not automatically mean elimination of a previous one.

    So, you're ending up having multiple...

  • RE: Converting and Assigning a Date Variable

    vr3357 (12/23/2015)


    Hello,

    I have the following script:

    execute sp_operations123 '2015/12/23'

    If I declare a variable called @today, how can I assign that variable with value shown in the...

  • RE: How to identify OVERLAPPING records

    The query should be much simpler:

    SELECT * FROM OverlapTest T1

    INNER JOIN OverlapTest T2 ON T2.ItemNo = T1.ItemNo

    WHERE T1.Start_Dt < T2.Start_Dt

    AND T2.Start_Dt < T1.End_Dt

    ORDER BY T1.Start_Dt, T2.Start_Dt

    And it identifies overlapping...

Viewing 15 posts - 1,726 through 1,740 (of 6,036 total)