Viewing 8 posts - 1 through 8 (of 8 total)
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..?
September 15, 2008 at 1:55 am
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
September 14, 2008 at 11:22 pm
I guess Convert(Len()) does it all
Ex:
select Convert(varchar,len(-1234.55))
September 14, 2008 at 11:16 pm
U can also use sql server 2005's with clause.
See Sql server 2005's Common Table Expressions for more.
September 14, 2008 at 11:12 pm
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...
September 14, 2008 at 11:06 pm
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,*...
September 14, 2008 at 10:41 pm
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...
September 14, 2008 at 10:29 pm
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...
September 11, 2008 at 3:08 am
Viewing 8 posts - 1 through 8 (of 8 total)