Ask a Question related to Microsoft SQL / MS SQL Server, Design and Development.
-
Tim Bird #1
Re: Newbie - Moving around (scrambling) data?
"Ricardo Forde" <anonymous@devdex.com> wrote in message
news:e4Ixd9JRDHA.1712@TK2MSFTNGP12.phx.gbl...Why are you trying to do this?> Hi I wodnering what is the best way to move data from 1 row to the next.
> In other words i want to move the firstname from the 50th row to the
> first and that from the first to the 50th....etc, etc.
>
> Any help on this would be great.
>
> Thanks a lot.
>
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Tim Bird Guest
-
moving data from one data source to another
I'm trying to move data from one data source to another. I don't want to loop - because it will kill performance. A simple Select into or Insert... -
Newbie needs help with moving backgrounds
I am a newbie trying to figure out how to do a front-to-back moving background for a game. I want to have my character remain in the center of the... -
Netscape inside firewall scrambling Flash
Help- I've taken over a site created by students. The administration wants me to fix it but content on many pages isn't even visible on computers... -
moving data with imbedded <CR> or <LF>
I have run into an interesting problem. We have generated data that contains bit data stored in a 16 byte character field. This last week I was... -
Newbie : Moving data from datagrid to datagrid
Hello, I have a dataset1, inside a table1 and a dataview1. I have a datagrid1 with datasource the dataview1. I have another datagrid2. I want,... -
Chris Brooksbank #2
Re: Newbie - Moving around (scrambling) data?
I would add another column to the table : ALTER TABLE <YourTableName> ADD
MyRowID INT IDENTITY
Looks like you need a temporary row to aid in swapping so add a row and make
note of its MyRowID value , call this <TempRowID>
Then to swap 50th and 1st :
UPDATE <YourTableName> SET FirstName = ( SELECT FirstName FROM
<YourTableName> WHERE MyRowID = 1) WHERE MyRowID = <TempRowID>
UPDATE <YourTableName> SET FirstName = ( SELECT FirstName FROM
<YourTableName> WHERE MyRowID = 50 ) WHERE MyRowID = 1
UPDATE <YourTableName> SET FirstName = ( SELECT FirstName FROM
<YourTableName> WHERE MyRowID = <TempRowID> ) WHERE MyRowID = 50
When finished delete the temp row
- Chris Brooksbank
"Ricardo Forde" <anonymous@devdex.com> wrote in message
news:e4Ixd9JRDHA.1712@TK2MSFTNGP12.phx.gbl...> Hi I wodnering what is the best way to move data from 1 row to the next.
> In other words i want to move the firstname from the 50th row to the
> first and that from the first to the 50th....etc, etc.
>
> Any help on this would be great.
>
> Thanks a lot.
>
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Chris Brooksbank Guest
-
oj #3
Re: Newbie - Moving around (scrambling) data?
Aaron has some paging info here... [url]http://www.aspfaq.com/show.asp?id=2120[/url]
--
-oj
RAC v2.2 & QALite!
[url]http://www.rac4sql.net[/url]
"Ricardo Forde" <anonymous@devdex.com> wrote in message
news:e4Ixd9JRDHA.1712@TK2MSFTNGP12.phx.gbl...> Hi I wodnering what is the best way to move data from 1 row to the next.
> In other words i want to move the firstname from the 50th row to the
> first and that from the first to the 50th....etc, etc.
>
> Any help on this would be great.
>
> Thanks a lot.
>
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
oj Guest



Reply With Quote

