Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. moving column in sql

moving column in sql

Scheduled Pinned Locked Moved Database
databasetutorialquestion
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Milad Biroonvand
    wrote on last edited by
    #1

    how to moving column in sql ? by code ?

    G D T 3 Replies Last reply
    0
    • M Milad Biroonvand

      how to moving column in sql ? by code ?

      G Offline
      G Offline
      GenJerDan
      wrote on last edited by
      #2

      Which database? MS SQL server from 2005 on - can't be done anymore. They took the ability out. Other databases...don't know...but a Google for ALTER COLUMN ORDER might bring some up.

      Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life. My Mu[sic] My Films My Windows Programs, etc.

      1 Reply Last reply
      0
      • M Milad Biroonvand

        how to moving column in sql ? by code ?

        D Offline
        D Offline
        David Skelly
        wrote on last edited by
        #3

        What do you mean "move"? Do you mean move it from one table to another? Or change the order in which the column appears in a query result set? Or change the order in which the column is defined in the table?

        M 1 Reply Last reply
        0
        • M Milad Biroonvand

          how to moving column in sql ? by code ?

          T Offline
          T Offline
          thatraja
          wrote on last edited by
          #4

          Try this SQL SERVER – Change Order of Column In Database Tables[^]

          thatraja


          **My Tip/Tricks
          My Dad had a Heart Attack on this day so don't...
          **

          M 1 Reply Last reply
          0
          • D David Skelly

            What do you mean "move"? Do you mean move it from one table to another? Or change the order in which the column appears in a query result set? Or change the order in which the column is defined in the table?

            M Offline
            M Offline
            Milad Biroonvand
            wrote on last edited by
            #5

            Hi Thank you for the answer In your table, not the other table I mean, is the priority fields

            1 Reply Last reply
            0
            • T thatraja

              Try this SQL SERVER – Change Order of Column In Database Tables[^]

              thatraja


              **My Tip/Tricks
              My Dad had a Heart Attack on this day so don't...
              **

              M Offline
              M Offline
              Milad Biroonvand
              wrote on last edited by
              #6

              What this command do? EXEC sp_rename @objname = ‘test.col3_new’, @newname = ‘col3′, @objtype = ‘COLUMN’ Whether the priorities are changed? This will only change the name? But I want to change priority Thanks!

              P 1 Reply Last reply
              0
              • M Milad Biroonvand

                What this command do? EXEC sp_rename @objname = ‘test.col3_new’, @newname = ‘col3′, @objtype = ‘COLUMN’ Whether the priorities are changed? This will only change the name? But I want to change priority Thanks!

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                What do you mean by change priority? Do you mean you want to affect how the result is ordered (in other words, how it is sorted)?

                Forgive your enemies - it messes with their heads

                My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups