Forum Replies Created

Viewing 15 posts - 8,416 through 8,430 (of 8,731 total)

  • RE: Fun with Outer Joins

    thisisfutile (9/11/2012)


    Luis Cazares (9/10/2012)


    CELKO (9/9/2012)


    The correct terms are "preserved table " and "unpreserved table" ...

    Can you explain us these terms? I can't find any reference on the web.

    While I'm sure...

  • RE: ALTER COLUMN fails when changing datatype of PRIMARY KEY

    Eugene Elutin (9/13/2012)


    ...

    Do you realistically expect to write to this table more times that the number of atoms in the Universe?

    ...

    Sorry, I completely forgot this one. Could you please...

  • RE: Can I add a bookmark in query window so that could be easier to go back?

    Does this image helps?

  • RE: T-SQL Help Needed

    I agree with your reasons Jeff, but I don't see any reason why are there only id columns instead of issue_id, jrn_id, details_id, etc.

  • RE: Puzzle : Generating two unique numbers from an array of numbers (repetation not allowed)

    Try performance by time (miliseconds or nanoseconds)

    DECLARE @ddatetime2

    SET @d = SYSDATETIME()

    with a(num) as

    (select 1 union select 2 union select 3 union /*select 4 union*/ select 5 union /*select 6 union*/...

  • RE: Puzzle : Generating two unique numbers from an array of numbers (repetation not allowed)

    Eugene Elutin (9/12/2012)


    You don't really need last join as the last digit of the second number can only be '3'

    Wouldn't that be cheating?

    Because that way I can get the...

  • RE: How to get week of a mont with input parameter date.

    In 2005 there are TVF (Table Valued Functions)

    There are not Table Value Constructors.

    Is that what you meant?

    It can be fixed by

    declare @TestDate date = '2012-09-12';

    with SevenRows(n) as (

    ...

  • RE: CS Collation

    sestell1 (9/12/2012)


    Thanks for the question... I never understand these collation quirks.

    According to the documentation:

    _CS_AS = Case-sensitive, accent-sensitive, kana-insensitive, width-insensitive

    If it's case-sensitive but NOT width-sensitive, why is "peppers" at the end??

    Width-sensitive...

  • RE: CS Collation

    For my understanding:

    1. It sorts the words regardless of their case one letter at a time. A shorter word will come before a longer one because spaces come before letters...

  • RE: NOT IN query very expensive, 100% CPU

    Another option:

    SELECTtable1.column1,

    '99',

    left(table1.column2,2),

    max(table1.column3),

    'Yes',

    'Test'

    FROMtable1

    LEFT

    JOINtable2 ON ltrim(rtrim(table1.column1))+ltrim(rtrim(left(table1.column2,2)))

    = ltrim(rtrim(table2.column1))+ltrim(rtrim(left(table2.column2,2)))

    WHERE table2.column1 IS NULL

    AND table1.column4 = 'Yes'

    GROUP BY table1.column1,left(table1.column2,2)

  • RE: T-SQL Help Needed

    Have you tried this article? It might help you with what you're trying to accomplish.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns [/url]

  • RE: Recursive CTE for BOM Structures

    I'm not sure if this gives the correct results. I can't compare it to anything but it should give you something to start with.

    ;WITH Sample AS(

    SELECTI.StockCode,

    B.ParentPart,

    B.Component,

    B.QtyPer,

    B.Route,...

  • RE: Adding GROUP BY to PIVOT operator (how?)

    For general knowledge and maybe performance (you'll have to test your case), I leave you with my personal preference:

    SELECT DeptName,

    SUM( CASE WHEN YEAR( StartDate) = 2001 THEN 1 ELSE 0...

  • RE: How to insert empty row

    ramadesai108 (9/11/2012)


    Cannot do that because that will require too many changes in the application.

    Why? How are you populating your Excel file?

    Are you sure this is the correct approach? I'm not...

  • RE: Union Query with 'duplicates'

    It depends :hehe:

    I had the same question and ran queries on tables with over 9million rows on SQL Server 2005 and 2008 (I used mine and Chris, I should have...

Viewing 15 posts - 8,416 through 8,430 (of 8,731 total)