THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Linchi Shea

Checking out SQL Server via empirical data points

Performance impact: Speeding up SMO script generation – the test code

The attached is the C# code that I used for generating the test results charted in my previous post.

 

Note that for testing no generated script is actually persisted into a file by this program. The Script() method is applied, but the resulting script strings are thrown away. For example, here is how a stored procedure is scripted:

 

StringCollection sc = db.StoredProcedures.ItemById(objectId).Script();

foreach (string s in sc)

  { };

 

You can run the compiled program as follows:

 

cmd>smpScript.exe <server name> <database name> <number of threads>

Published Tuesday, December 15, 2009 3:10 PM by Linchi Shea
Filed under: , ,

Attachment(s): smoScript.zip

Comments

 

ALZDBA said:

Thank you for your test code!

Also keep in mind that providing the correct script parameters for the object to are scripting, will vastly speed up its processing !

December 16, 2009 2:23 AM
New Comments to this post are disabled

About Linchi Shea

Checking out SQL Server via empirical data points

This Blog

Syndication

Privacy Statement