Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)

  • RE: How do I remove the temp table from this query

    Instead of creating a temp table and inserting rows into it, just create a CTE and select values into it. Your temp table is removed now..?

  • RE: I need to add a suffix to duplicate values

    You'll have to go match by match or else use cursors

    First: select all rows with same column values

    Hold a suffix variable

    update each row and increment suffix when updating

  • RE: Report # of characters for an integer value

    I guess Convert(Len()) does it all

    Ex:

    select Convert(varchar,len(-1234.55))

  • RE: How do I remove the temp table from this query

    U can also use sql server 2005's with clause.

    See Sql server 2005's Common Table Expressions for more.

  • RE: Updating more than one rows at a time

    First:

    Define a function that maps employeeID to col1's value.. If you can create such a function all you have to do is:

    update table1

    set col1=select convertEmployeeIdToCol1(id)

    Secondly: Updating data for...

  • RE: sqlquery

    WIth temp table and Row_Number()

    Row_Number() numbers the rows on the basis of the "order by.." as specified by the over clause.

    select Row_Number() over (order by id) as No,*...

  • RE: sqlquery

    Hi SSC!

    If the row you need is at number 40 when the result is in ascending order, u don't need to sort the rows in descending order 🙂

    Also, using a...

  • RE: sqlquery

    What u can do is:

    select top 40 * from table_name

    except

    select top 39 * from table_name order by column_name desc

    Remember the order by clause determines your ans...

Viewing 8 posts - 1 through 8 (of 8 total)