Click here to Skip to main content
15,922,574 members
Home / Discussions / Database
   

Database

 
GeneralRe: data joins Pin
Blue_Boy26-Apr-08 11:22
Blue_Boy26-Apr-08 11:22 
GeneralRe: data joins Pin
Rami Said Abd Alhalim26-Apr-08 20:17
Rami Said Abd Alhalim26-Apr-08 20:17 
Questionsqlserver Pin
Member 470807726-Apr-08 10:09
Member 470807726-Apr-08 10:09 
GeneralRe: sqlserver Pin
Blue_Boy26-Apr-08 10:18
Blue_Boy26-Apr-08 10:18 
GeneralRe: sqlserver Pin
Krazy Programmer26-Apr-08 19:15
Krazy Programmer26-Apr-08 19:15 
GeneralDatabase is locked when executing insert multi row Pin
lvantin26-Apr-08 6:28
lvantin26-Apr-08 6:28 
GeneralAbout Auto Numbers Pin
savitri26-Apr-08 0:16
savitri26-Apr-08 0:16 
GeneralRe: About Auto Numbers Pin
Blue_Boy26-Apr-08 3:51
Blue_Boy26-Apr-08 3:51 
this is what I suggest you:

Don't set column SInumber as AutoNumber, set value by code, when you insert row get max of SInumber and increase by 1.

When you delete one row reset values of column SInumber by this method to get regular numbers e.g:1,2,3,4, and so on:

declare @i as int<br />
set @i =  0<br />
declare @rowCount as int<br />
set @rowCount =(select count(SInumber) from myTable) <br />
<br />
while @i <= @rowCount <br />
begin<br />
     set @i = @i +1<br />
      <br />
     if(select count(SInumber) from myTable where SInumber =@i)=0 <br />
     begin<br />
          Update myTable set SInumber = @i where SInumber =@i+1          <br />
     end      <br />
end



I Love T-SQL

AnswerRe: About Auto Numbers Pin
Ashfield27-Apr-08 7:10
Ashfield27-Apr-08 7:10 
GeneralSchedule a program Pin
yesu prakash25-Apr-08 20:30
yesu prakash25-Apr-08 20:30 
GeneralRe: Schedule a program Pin
Pete O'Hanlon25-Apr-08 23:55
mvePete O'Hanlon25-Apr-08 23:55 
GeneralRe: Schedule a program Pin
GuyThiebaut26-Apr-08 3:41
professionalGuyThiebaut26-Apr-08 3:41 
Generaloledb query Pin
Member 412921825-Apr-08 20:07
Member 412921825-Apr-08 20:07 
GeneralRe: oledb query Pin
Blue_Boy26-Apr-08 3:15
Blue_Boy26-Apr-08 3:15 
GeneralRe: oledb query Pin
ChinaTJBoy1-May-08 3:39
ChinaTJBoy1-May-08 3:39 
GeneralRe: oledb query Pin
Member 30299284-May-08 19:55
Member 30299284-May-08 19:55 
GeneralCreate a custom search string Pin
Paul McGann25-Apr-08 7:42
professionalPaul McGann25-Apr-08 7:42 
GeneralRe: Create a custom search string Pin
Mark J. Miller25-Apr-08 9:06
Mark J. Miller25-Apr-08 9:06 
GeneralRe: Create a custom search string Pin
Paul McGann25-Apr-08 9:45
professionalPaul McGann25-Apr-08 9:45 
GeneralRe: Create a custom search string Pin
ChandraRam27-Apr-08 23:24
ChandraRam27-Apr-08 23:24 
Questionis it possible to replicate mysql data on mssql server [modified] Pin
Talsaniya Jayesh25-Apr-08 5:27
professionalTalsaniya Jayesh25-Apr-08 5:27 
QuestionApplication roles Pin
aecordoba25-Apr-08 4:15
aecordoba25-Apr-08 4:15 
Generaltotal Impression for same id and name Pin
r aa j24-Apr-08 23:04
r aa j24-Apr-08 23:04 
GeneralRe: total Impression for same id and name Pin
Blue_Boy25-Apr-08 0:05
Blue_Boy25-Apr-08 0:05 
GeneralRe: total Impression for same id and name Pin
andyharman25-Apr-08 0:12
professionalandyharman25-Apr-08 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.