In SQL Server Management Studio, go to Options / SQL Server Object Explorer / Scripting, and enable ‘Generate script for dependent objects’. Then right click the table, script > drop to > new query window and it will generate it for you.
More Related Contents:
- Copy tables from one database to another in SQL Server
- Saving changes after table edit in SQL Server Management Studio
- SQL Server 2005 – Export table programmatically (run a .sql file to rebuild it)
- Should I use the CASCADE DELETE rule? [duplicate]
- Get Parent with multiple children in desc order
- How can I schedule a job to run a SQL query daily?
- Convert Month Number to Month Name Function in SQL
- SQL Server 2012 column identity increment jumping from 6 to 1000+ on 7th entry [duplicate]
- Reset identity seed after deleting records in SQL Server
- How to avoid the “divide by zero” error in SQL?
- Multiple INSERT statements vs. single INSERT with multiple VALUES
- Limit on the WHERE col IN (…) condition
- Removing leading zeroes from a field in a SQL statement
- Get day of week in SQL Server 2005/2008
- Getting result of dynamic SQL into a variable for sql-server
- Better techniques for trimming leading zeros in SQL Server?
- Simple Query to Grab Max Value for each ID
- SQL Server: Extract Table Meta-Data (description, fields and their data types)
- SQL Server 2008: how do I grant privileges to a username?
- SQL GROUP BY CASE statement with aggregate function
- How can I include null values in a MIN or MAX?
- Favourite performance tuning tricks [closed]
- Best way to do nested case statement logic in SQL Server
- Query a database based on result of query from another database
- How to delete the top 1000 rows from a table using Sql Server 2008?
- CHECK CONSTRAINT on multiple columns
- Cannot create an instance of OLE DB provider Microsoft.Jet.OLEDB.4.0 for linked server null
- SQL count consecutive days
- COALESCE Function in TSQL
- Can’t create stored procedure with table output parameter