Results 1 to 9 of 9

Thread: how to write script to copy table structure only

  1. #1
    Join Date
    Jul 2004
    Location
    bay area
    Posts
    61

    how to write script to copy table structure only

    Hi, All
    I need to create a empty table which is a copy of an existing table structure including primary keys etc.,
    but my testing database is MSDE, no enterprise manager, can you tell how to do it. Oracle statement won't work here.
    Thanks
    Betty

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

  3. #3
    Join Date
    Jul 2004
    Location
    bay area
    Posts
    61
    Thanks, MAK, that's good resource.
    After I generated script and I put it under my documents dir, use cmd window to execute generatetable.sql.
    I typed :
    osql -E
    use CMC
    go
    generatetable
    go
    it keeps coming up message with
    "could not find store procedure generatetable or generatetable.sql
    why?
    Betty

  4. #4
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    You have to pass the file as input parameter

    osql -E -dCMC -igeneratetable.sql -Sservername

  5. #5
    Join Date
    Jul 2004
    Location
    bay area
    Posts
    61
    Thanks, MAK, that's good resource.
    After I generated script and I put it under my documents dir, use cmd window to execute generatetable.sql.
    I typed :
    osql -E
    use CMC
    go
    generatetable
    go
    it keeps coming up message with
    "could not find store procedure generatetable or generatetable.sql
    why?
    Betty

  6. #6
    Join Date
    Jul 2004
    Location
    bay area
    Posts
    61
    skhanal,
    Thanks you so much for your reply. You replied a few of my threads already, and you really make my life much easier. I work in a small company where resources are very limited. You just never know how much I appreciated your contribution to this board.
    Betty

  7. #7
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    BTW that article was written by SKhanal.

  8. #8
    Join Date
    Jul 2004
    Location
    bay area
    Posts
    61
    I am blind. When I looked at the author of this article, I just feel so familiar, it looks like...never aware it is him until now.
    Thanks for telling me.
    Betty

  9. #9
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Glad to be of help

Posting Permissions

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