posts - 220, comments - 411, trackbacks - 27

My Links

Advertisement

News

Follow billgraziano on Twitter

Article Categories

Archives

Post Categories

Consulting

SQL Server

SQL Server 2005 object scripting tool source code

I posted the source code for my SQL Server 2005 object scripting tool. The code reads like something I threw together to see if I could really do this. Because that's what it is. You can read a prior post that describes a little of what it does.

The ClickOnce deployment is available here: http://www.sqlteam.com/publish/scriptio/

It's at version 0.5.1 as I type this. New features include:

  • Connect to SQL Server using SQL Server accounts
  • Option to include collation in the script
  • Can optionally qualify creates, drops foreign keys with the schema

Update: Most recent install and source code:  http://weblogs.sqlteam.com/billg/archive/2006/06/13/10208.aspx

Print | posted on Saturday, December 24, 2005 12:05 PM | Filed Under [ SQL Server Stuff Software Development Utilities ]

Feedback

Gravatar

# re: Scripting Objects in SQL Server 2005

1/3/2006 12:40 PM | The Lazy DBA
Gravatar

# re: SQL Server 2005 object scripting tool source code

I anxious to see the code.
1/11/2006 9:38 AM | Rob
Gravatar

# re: SQL Server 2005 object scripting tool source code

If you click on the Source Code link above you can download it.
1/11/2006 10:31 AM | Bill
Gravatar

# Scriptio - Scripting Objects in SQL Server 2005

Bill Graziano has developed a tool called Scriptio which is available for downlo
3/6/2006 2:37 PM | some thoughts...
Gravatar

# re: SQL Server 2005 object scripting tool source code

Is this the latest source code? The tool worked fine when I installed via one-click but when I compile and run it, it blows up when I click the script button. I made some code changes to fix that problem but the scripts its generating have some weird control characters in them that don't show up in the regular version I installed.

Any ideas?
3/27/2006 5:07 PM | David
Gravatar

# re: SQL Server 2005 object scripting tool source code

In the btnScript_Click handler, I modified the code to do the following:

Server srv = new Server(new ServerConnection(this.GetConnection("tempdb")));

Database db = srv.Databases[ddlDatabases.SelectedItem.ToString()];

It works fine for me after this.
5/24/2006 3:27 PM | Harry Chou
Gravatar

# re: SQL Server 2005 object scripting tool source code

Has anyone been able to get the default constraints to script out correctly. I thought it would simply be a matter of adding this line:

baseOptions.Default = chkDefaults.Checked;

Where chkDefaults is the new checkbox I added to the form. Everything runs fine, but no default constraints are scripted. Any ideas?
8/7/2006 3:46 PM | Ryan Feiock
Gravatar

# re: SQL Server 2005 object scripting tool source code

soooooo cool... thanks
8/9/2006 10:32 AM | Mitch
Gravatar

# re: SQL Server 2005 object scripting tool source code

I would like to generate the drop or create index/constraints without dropping the table...does this GUI do that or do I have grep the results to ALTER instead?
4/10/2007 8:12 AM | LenN
Gravatar

# re: SQL Server 2005 object scripting tool source code

I think you'll have to post-process the script. Alternatively you could just use the code and write your own tool.
4/10/2007 8:39 AM | Bill Graziano
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET