Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to make a script of the database structure

Author  Topic 

yagorik
Starting Member

12 Posts

Posted - 2011-06-02 : 13:10:12
How to make a script of the database structure without using the Tasks-> Generate Scripts ... from Microsoft SQL Server Management Studio. It may be possible to call this function with SQLQuery?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-06-02 : 13:14:32
Best way to script it is using Powershell and SMO, many techniques listed here:

http://www.google.com/search?q=powershell+script+database+objects
Go to Top of Page

yagorik
Starting Member

12 Posts

Posted - 2011-06-03 : 04:20:34
whether this can be done through SSIS?
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2011-06-03 : 06:51:57
a data dictionary type thingy?

select 
c.table_name, c.column_name, c.data_type, [Comment]= ''
from
information_schema.columns c
inner join
information_schema.tables t
on
c.table_catalog = t.table_catalog
and
c.table_name = t.table_name
where
t.table_type = 'BASE TABLE'
order by
c.table_name


http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -