0

I want to get script for creating table. Now I use "Right Click - All task- Generate SQL Script" to create this script. How to make this action using a query? Existing solutions isn't suitable for me because it works only in SQL Server 2005 or later.

Thanks.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Please post what you have done so far, (the codes that does not work for you) and the error you get – Ormoz Sep 26 '15 at 01:03
  • @Ormoz, for example, when I use query in this post [link](http://stackoverflow.com/questions/706664/generate-sql-create-scripts-for-existing-tables-with-query) query analyzer return me errors: Line 17: Incorrect syntax near 'MAX'. Line 30: Incorrect syntax near ','. Line 69:Incorrect syntax near the keyword 'FOR'. Line 78: Incorrect syntax near 'XML'. Line 95: Incorrect syntax near 'XML'. Line 102:Incorrect syntax near the keyword 'FOR'. Line 144:Must declare the variable '@SQL'. – Dmitry Bakay Sep 26 '15 at 15:17
  • This is work with.net code. If you are using sql management studio. And you can access this functions in Microsoft.sqlserver.management assembly – umut özkan Sep 26 '15 at 21:17

0 Answers0