On 4/25/07, Derek Kalweit <[EMAIL PROTECTED]> wrote:
> Hello. I'm sure I'm not the first to have the need for it-- I need a
> way to detect the current database setup(tables, fields, indexes) and
> alter the MSSQL database appropriately based on the current state. I
> have a small VBS script written that can do this for tables and fields
> using INFORMATION_SCHEMA.TABLES and INFORMATION_SCHEMA.COLUMNS, but I
> can't find an easy way to do the same for indexes. I use an XML file
> for my database definition.
>
> Is there a better way? Some way to easily get the index information
> and create/modify them as needed? I'm sure I could probably use the
> sys tables in the master database, but I was hoping there might be
> something easier-- an API even... Anything MSSQL, VFP, VBS, T-SQL,
> .NET, etc. could be a good solution.

On MSSQL 2K you can right-click the database and chose "All Tasks >
Generate SQL Script..." to generate TSQL scripts. You can do this for
individual objects, too. Query Analyzer has similar functionality if
you left click an object in the object browser pane.

dt

-- 
Dave Thayer
Denver, CO


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to