Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2006
    Location
    Quebec
    Posts
    172

    Unanswered: INSERT AS 1st ROW

    Hi all!

    I'm using MS SQL SERVER 2005 SP2, and I wanna do something tricky.

    I don't know if SQL has a way to do it but I want to insert a row at the begining of a table instead of inserting at the end.

    Anybody knows how to do it ?

    Thanks

    Or Tho
    Less is more.
    How long is now?
    http://www.lesouterrain.com

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    There is no "beginning" of a table, or "end" of a table. What are you trying to do?

  3. #3
    Join Date
    Nov 2006
    Location
    Quebec
    Posts
    172
    I was only wondering because I use a messy Proc to retreive the column name in the first row.

    And I wanna know if I can insert a row a the begining of a table, but this isn't the best way to do it because I will not be able to sort my datas if I do that...

    So ... Don't waste your time on this one...

    Thank you anyway.

    Regards
    Or Tho
    Less is more.
    How long is now?
    http://www.lesouterrain.com

  4. #4
    Join Date
    Feb 2004
    Location
    Burbank & Santa Cruz de la Sierra
    Posts
    3,716
    Yeah, sounds like you should familiarize yourself with relational database concepts a bit. There is no "order" for the data in a table, you need to "create" your "order" by the use of keys. Oh wait, you said NOT to waste time...dang it. *sigh*
    aka "Paul"
    Non est ei similis.

    I just read "100 Things To Do Before You Die". I was surprised that "Yell for help!!" wasn't one of them

  5. #5
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    the only ordering you can do is in a select statement, when you specify an ORDER BY clause.

    if you do a SELECT...ORDER BY... then it matters not what rows were created "first". they will always come back ordered properly.

    see: http://blogs.msdn.com/sqltips/archiv...20/441053.aspx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •