Results 1 to 5 of 5

Thread: schema of table

  1. #1
    Join Date
    Aug 2009
    Posts
    37

    Cool Unanswered: schema of table

    Hi

    i have a two databses one is "test" and another database is "sample"

    i have a table in "test" database ,i want table in "sample" database with the same structre of "test" databse table.

    thanks

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Assuming they are on the same server

    Without Data

    USE Test
    GO

    SELECT * INTO Sample.dbo.table FROM Table WHERE 1=0

    Without

    USE Test
    GO

    SELECT * INTO Sample.dbo.table FROM Table


    Enjoy every doughnut
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Aug 2009
    Posts
    37
    Hi

    thanks breet kaiser
    its working fine

  4. #4
    Join Date
    Dec 2007
    Location
    London, UK
    Posts
    741
    Generate a script for the table and run the script in the target database.

    Note that the SELECT INTO method will create the basic structure of columns but it won't copy other important information such as keys and constraints, defaults, indexes, IDENTITY columns, permissions and so on.

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by dportas
    Generate a script for the table and run the script in the target database.

    Note that the SELECT INTO method will create the basic structure of columns but it won't copy other important information such as keys and constraints, defaults, indexes, IDENTITY columns, permissions and so on.


    YEAH!!!


    And you think THEY think that far down te road
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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