SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2010
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Insert a field after an existing field

    I have already create a Database in c:\path\db1.mdf.

    I also created a Table, table1, and a few Fields: field1, field2, field3, etc.

    In SQL I would like to know how to populate a list of each Field in that Table.

    I also would like to know how to insert a Field after an existing Field previously mentioned.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Philosophaie View Post
    In SQL I would like to know how to populate a list of each Field in that Table.
    not sure what you mean by "populate a list of each Field"

    Quote Originally Posted by Philosophaie View Post
    I also would like to know how to insert a Field after an existing Field previously mentioned.
    it's not mysql, so you can't

    good thing is, you don't really need to, since you can always return the columns in whatever sequence you want when you SELECT
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,178
    Mentioned
    64 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Philosophaie View Post
    I have already create a Database in c:\path\db1.mdf.

    I also created a Table, table1, and a few Fields: field1, field2, field3, etc.

    In SQL I would like to know how to populate a list of each Field in that Table.

    I also would like to know how to insert a Field after an existing Field previously mentioned.
    You'll want to look at this:

    http://stackoverflow.com/questions/4...t-column-names

    and then right hurr:

    http://www.tech-recipes.com/rx/378/a...g-mysql-table/

  4. #4
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,178
    Mentioned
    64 Post(s)
    Tagged
    2 Thread(s)
    Woops, just saw this is mssql, syntax may be slightly different, but you can find your way from here, they are both available for SQL server as well

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by K. Wolfe View Post
    Woops, just saw this is mssql
    maybe it is, maybe it isn't

    on another discussion forum, he's got a thread going in the mysql forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    Non-Member
    Join Date
    Feb 2013
    Location
    indore
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello,
    you can read w3school it's good for basic of the database query.

  7. #7
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,178
    Mentioned
    64 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by amitchoudhary View Post
    hello,
    you can read w3school it's good for basic of the database query.
    No. No. No. Never. w3school should be blocked by ISPs world wide. Bad source

  8. #8
    Non-Member
    Join Date
    Feb 2013
    Location
    indore
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok.........but i used this so i suggest you.......

  9. #9
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,178
    Mentioned
    64 Post(s)
    Tagged
    2 Thread(s)


Bookmarks

Posting Permissions

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