Forum Replies Created

Viewing 15 posts - 2,686 through 2,700 (of 2,894 total)

  • RE: Loop, Cursor or both?

    george.greiner (6/24/2010)


    ...I have not used cursors before...

    And I believe, you don't need to use the cursor in this case as well 😀

    Please provide some DDL script to setup tables and...

  • RE: Problems Formating results in XML

    I don't think you can do it with FOR XML AUTO, you need to use EXPLICIT option.

    Try:

    -- setup test data

    /*

    insert into Table_1 select 1, 'f1 data', 'f2 data'

    insert into...

  • RE: Copying Table1 to Table2

    Here is minimalist approach (use setup provided by skcadavre):

    DELETE dbo.table1 OUTPUT deleted.places INTO dbo.table2 (places)

    INSERT INTO dbo.table1 (places)

    SELECT DISTINCT places FROM dbo.table2

    There is a setback here: if, at the...

  • RE: [ASK] how to measure SQL Server performance

    Marking performance good or bad mostly depends on requirements and of cause of what you are doing.

    For example, business expects that search of some data in a web based application...

  • RE: Problem with Group by clause

    The error you are getting is due to grouping by a constant result value of

    CASE

    WHEN @timespan = 'YTD'

    THEN DATEPART(Year,getdate())

    WHEN @timespan = 'Q'+CAST(DATEPART(quarter,getdate()) AS VARCHAR)+' '+CAST(DATEPART(YEAR,getdate()) AS VARCHAR)

    THEN...

  • RE: Rename Temporary Table Name?

    Jeff Moden (6/24/2010)


    Eugene Elutin (6/24/2010)


    Jeff Moden (6/23/2010)


    I don't believe so. Not in any forthright manner, anyway. Perhaps if you explained why you need to do such a thing,...

  • RE: working operations on rows on event fire

    What the row number is to do with ID's of records?

    Just delete it and that's it, when retrieving records back order them by ID. You should not delete record by...

  • RE: working operations on rows on event fire

    You better not update the IDs.

    Is any valid reason or requirement to do it?

    At the end you don't need the cursor to do re-numbering.

  • RE: INSERT INTO SELECT WITH ORDER BY

    GilaMonster (6/24/2010)


    Eugene Elutin (6/24/2010)


    Hi Joe, since when are you back to a dusty Texas? Or how you managed to get internet connection in your Borneo hut?

    That's uncalled for.

    I would like...

  • RE: INSERT INTO SELECT WITH ORDER BY

    Thanks, Paul!

    That is the key! Adding another index to the table made me happy and explained everything!

    As soon as second (non-clustered) index added, SQL may deside to use it to...

  • RE: Problem with Group by clause

    The following might cause your problem (in select part):

    CASE

    WHEN c.Perfect_Journey_Tech_Exception_Flag IS NULL

    OR c.Perfect_Journey_Tech_Exception_Flag = 0

    THEN COUNT(c.Container_Key) ELSE 0

    END AS PerfectJourney

    Try to change it to:

    SUM(

    CASE

    WHEN c.Perfect_Journey_Tech_Exception_Flag...

  • RE: Problem with Group by clause

    [comment withdrawn]

  • RE: Select statement with Group BY

    Vinay Theethira (6/24/2010)


    Here is my SQL Query, This query should not fetch duplicate contactID(i.e Same ContactID).but when i execute the query i get duplicated ContactID. Could anyone tell me what...

  • RE: Rename Temporary Table Name?

    Jeff Moden (6/23/2010)


    I don't believe so. Not in any forthright manner, anyway. Perhaps if you explained why you need to do such a thing, we could suggest an...

  • RE: INSERT INTO SELECT WITH ORDER BY

    Joe Celko (6/23/2010)


    ...

    If you have some of my books, you can read a few thousand words on this topic. I don't have my usual "cut & paste" here right now,...

Viewing 15 posts - 2,686 through 2,700 (of 2,894 total)