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. Move table from one database to another database

Move table from one database to another database

Scheduled Pinned Locked Moved Database
databasequestion
4 Posts 2 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.
  • V Offline
    V Offline
    vanikanc
    wrote on last edited by
    #1

    Hello All, Need to move certain tables, not all tables from one database to another database, all the data and its properties. This is in SQL 2005? Any pointers? Thanks!

    S 1 Reply Last reply
    0
    • V vanikanc

      Hello All, Need to move certain tables, not all tables from one database to another database, all the data and its properties. This is in SQL 2005? Any pointers? Thanks!

      S Offline
      S Offline
      Simon_Whale
      wrote on last edited by
      #2

      you have many choices. 1. import and export 2. using the following code, but it don't copy across any indexes etc.

      select *
      into database.owner.tablename
      from table

      MSDN : Select into[^]

      As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

      V 1 Reply Last reply
      0
      • S Simon_Whale

        you have many choices. 1. import and export 2. using the following code, but it don't copy across any indexes etc.

        select *
        into database.owner.tablename
        from table

        MSDN : Select into[^]

        As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

        V Offline
        V Offline
        vanikanc
        wrote on last edited by
        #3

        By performing the select, it does not copy over the indexes set up on the table, it just copies over the data. All features/properties of the table needs to copied over?

        S 1 Reply Last reply
        0
        • V vanikanc

          By performing the select, it does not copy over the indexes set up on the table, it just copies over the data. All features/properties of the table needs to copied over?

          S Offline
          S Offline
          Simon_Whale
          wrote on last edited by
          #4

          Create Script to Copy Database Schema and All The Objects – Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects[^] Have a read of that

          As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

          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