SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Problem adding new records
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

RLETD
Starting Member

Netherlands
4 Posts

Posted - 05/05/2011 :  02:09:24  Show Profile  Reply with Quote
I don't know if this is the right place to put this but I didn't find any other suitable forum.

I have a problem when adding a new record (row) in a table. It appears on row 1 instead of the bottom row (266). It doesn't make a difference if I add it from my vb.net app or through management studio. Does anyone know this problem and is there a solution?

Many thanks

Kind Regards,

René

khtan
In (Som, Ni, Yak)

Singapore
17658 Posts

Posted - 05/05/2011 :  02:18:36  Show Profile  Reply with Quote
don't worry about that. That is just how the Management Studio display the record to you.

Yes. It makes no different if you add the record via your application or the Management Studio


KH
Time is always against us

Go to Top of Page

RLETD
Starting Member

Netherlands
4 Posts

Posted - 05/05/2011 :  02:37:07  Show Profile  Reply with Quote
Thanks for your quick reply.
My vb app reads the table from the top and gets the first row with Id=266 but it needs to be Id=1. It was working fine until now. I have tried sorting the table but that didn't help. Any ideas?


Kind Regards,

René
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17658 Posts

Posted - 05/05/2011 :  02:42:12  Show Profile  Reply with Quote
you have a Id column in the table ?

add a ORDER BY Id to your query


KH
Time is always against us

Go to Top of Page

RLETD
Starting Member

Netherlands
4 Posts

Posted - 05/05/2011 :  02:49:23  Show Profile  Reply with Quote
The Id column is not autonumber. Before writing the new record I retrieve the last Id and add 1. Do I need to add ORDER BY ID before writing or before retrieving?

Kind Regards,

René
Go to Top of Page

RLETD
Starting Member

Netherlands
4 Posts

Posted - 05/05/2011 :  02:55:03  Show Profile  Reply with Quote
Silly question that was. I figured it out. Thanks for your input.

Kind Regards,

René
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000