0

Is there a way to retreive the create table script in t-sql. I tried the select into DBLocal.dbo.TableX from DBProduction.dbo.TablesX where 1=2 query but it does not create all constraints, keys and indexes.

Thank you

user3569267
  • 1,065
  • 3
  • 14
  • 27
  • [How to generate scripts to recreate table using SQL Server Management Studio?](https://stackoverflow.com/questions/13521085/how-to-generate-scripts-to-recreate-table-using-sql-server-management-studio#13521141) – Lukasz Szozda May 28 '18 at 13:08
  • thank you lad2025. I already know this solution. I am looking for a script that can give me also the create index statement. Maybe this can be done by joining the index dmv – user3569267 May 28 '18 at 15:00

0 Answers0