Solved

SQL 2005 - Scripting Tables with Triggers

Posted on 2009-07-08
9
156 Views
Last Modified: 2012-05-07
Hello,

I've got a database with a bunch of tables in it.  There are a certain number of the tables (not all) that I want to create a script so I can create them in another database.  These tables also has triggers associated with it.  How can I create a script that will create the tables and the triggers and relationships ect in the new database.  I am using SQL 2005.  Any help would be greatly appreciated.
0
Comment
Question by:UncleT
  • 4
  • 3
  • 2
9 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24806290
ssms -> tools -> options -> sql server object explorer- scripting -> enable script triggers
0
 

Author Comment

by:UncleT
ID: 24806362
aneeshattingal,

Under options I don't see "Sql Server Object Explorer"?  SEE ATTACHED FILE.
Options.jpg
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24806633
is that sql express ?
the one i gave was for sql 2008, and for 2005, you should be able to see a 'Scripting' menu query results and designers, even that one is missing in the above picture
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:UncleT
ID: 24806715
No this is not SQL Express.  This is from a regular machine where I installed sql tools.  This is not on the server.  Could that be the problem?  Here is the info from the About.


About.jpg
0
 

Author Comment

by:UncleT
ID: 24808546
The Designer menu item is there.  But I don't see any scripting menu item.  Can anyone help on this one??????
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 24810470
do u have sufficient permission?
also if you haven't installed the latest service pack sp3
even you can try installing the ssms for 2008, which is really good, you will be able to connect to sql 2005 from that
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 24811607
Hope you use Generate Scripts Wizard. In that case, just configure Scripting Triggers option in the wizard as shown in the picture below:
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 24811612
Missed attaching the file.
Generate-Scripts.JPG
0
 

Author Closing Comment

by:UncleT
ID: 31601237
Thanks for everyones help.  Installing SP3 solved my problem.  Thanks Again.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question