Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-01-12 : 08:40:34
|
| Nagulmeera writes "Hell guru'sI am new in SQL Server I have faced problem in navigating through the record sets in table.My problem is like this:"I want to insert at most 10 records in a table .when the table fileed withe 10 records i want to delete the first record from the table and insert the record at the end of the table.initailly the table contain Zero records .the table after fileed with 10 records is like thistable name:tbl_statusStatus-------------message1message2message3message4message5message6message7message8message9message10now i want to delete the message1 and insert a new message11,then the table should like thisStatus-------------message2message3message4message5message6message7message8message9message10message11Please any body help me how can i write a query.I am developing a " ASP "application: ======pleas ehelp me withe a sample code;ThanksNagulmeera" |
|
|
mikejohnson
Posting Yak Master
153 Posts |
Posted - 2005-01-12 : 10:35:24
|
| It would help if you had an auto generated id key or a date created field so it's easier to determine the first/last records. for example, if you had an id field, you could do something like this:delete from status where id=min(id)insert into status(field) values('message' + cast(max(id) as char(5))i think that will work but i haven't tested so.... |
 |
|
|
|
|
|