Sign In
Michiel Wories' WebLog
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Tags
FAQ
Microsoft
Netherlands/Europe
Pages
Personal
Powershell
SMO Samples
SQL Server
Windows Azure
WMI Samples
Browse by Tags
MSDN Blogs
>
Michiel Wories' WebLog
>
All Tags
>
smo samples
Tagged Content List
Blog Post:
SMO Sample: Enable TCP/IP Server protocol of SQL Server 2005
mwories
Purpose of sample: Enable the TCP/IP server protocol. This sample shows you how to change a server protocol setting. This sample assumes you have SQL Express installed. You need to change the instance name to match the instance name you have installed. ManagedComputer mc = new ManagedComputer...
on
10 Feb 2006
Blog Post:
SMO Samples Galore
mwories
With much of the SQL Server 2005 devcelopment behind us, I am starting to have some more time to post some SMO samples . Most of these are inspired on questions in the beta newsgroups or the SMO/DMO forum . Additionally, SQL Server 2005 ships with a pretty wide variety of samples. In fact, there are...
on
25 Oct 2005
Blog Post:
SMO Sample: Which SQL Server version is supported by the property?
mwories
Purpose of sample: List metadata information about SMO object properties SMO's object model is different from DMO in one important way: DMO introduced the '2' (like Database2) objects in order to add SQL Server 2000 support. SMO objects are hybrid in that perspective, as these objects morph or limit...
on
25 Oct 2005
Blog Post:
SMO Sample: Create and Start a Job
mwories
Purpose of sample: Create simple job and start the job after creation. Server svr = new Server (instance); JobServer agent = svr.JobServer; if (agent.Jobs.Contains( "New Smo Job" )) { agent.Jobs[ "New Smo Job" ].Drop(); } Job j = new Job (agent, "New Smo Job" ); JobStep js = new JobStep ...
on
24 Oct 2005
Blog Post:
SMO Sample: Backup database to Mirrors
mwories
Purpose of sample: Backup database to various mirrors Server svr = new Server ( ); Backup b = new Backup (); b.BackupSetDescription = "Set description"; b.Action = BackupActionType .Database; b.BackupSetName = "B ackup set #1"; b.Database = "msdb" ; b.MediaDescription = "Media description" ;...
on
18 Oct 2005
Blog Post:
SMO Sample: Partitions
mwories
Purpose of sample: create a partition function and partition scheme on an existing database Server svr = new Server (instance); if (svr.Databases.Contains( "smotestdb" )) // change the name if needed { svr.Databases[ "smotestdb" ].Drop(); } Database db = new Database (svr, "smotestdb" ); db...
on
18 Oct 2005
Blog Post:
SMO Sample: Transfer
mwories
Purpose of sample: Transfer a database; all objects and data Server tgt = new Server ( "." ); // Setup source connection (in this sample source is .\inst1 and target is '.' (the default instance) Server svr = new Server ( @".\inst1" ); Database db = svr.Databases[ "testdb" ]; // Setup transfer...
on
18 Oct 2005
Blog Post:
SMO Sample: Table column default constraint
mwories
Purpose of sample: show how a column constraint can be created. Table tbl = new Table (db, "MyTestTable" ); Column c1 = new Column (tbl, "c1" , DataType .DateTime); c1.AddDefaultConstraint( /*name optional*/ ); c1.DefaultConstraint.Text = "getdate()" ; tbl.Columns.Add(c1); tbl.Create(); Disclaimer...
on
18 Oct 2005
Blog Post:
SQL Server: Table Partitioning in SQL Server 2005
mwories
Table and Index partitioning is one if the new SQL Server 2005 features that willl improve life for the DBA and application developer quite a bit. It allows Indexes and Tables to be partitioned across multiple file groups. Partitioned tables and indexes, are fully manageable with SMO. Here is a quick...
on
24 Jun 2005
Blog Post:
SQL Server: Capture Object changes with SMO Capture Mode
mwories
In a previous article I have showed how a SMO object can be serialized into a Transact-SQL script, which allows you to recreate the object. What if you want to have the script that is emitted when you changed one or more properties of an object? In that case Capture Mode comes in handy. This switches...
on
31 May 2005
Blog Post:
SQL Server: SMO Scripting Basics
mwories
Let's first clarify what I mean by "scripting". It often happens during talks or when I explain SMO fundamentals that eyes gloss over, shortly after which the "what * do you mean by scripting" question pops up (replace the * with your favorite combination of adjective and noun to indicate bewilderment...
on
7 May 2005
Blog Post:
SQL Server: Tuning your SMO Application for great performance -- PART 2
mwories
In the previous post I provided you with a fundamental tool to minimize the amount of SQL statements emitted and therefore limit expensive network round-trips (and SQL statements) using the Server.SetDefaultInitFields() method. In this post I will provide you with some more detail about this method,...
on
2 May 2005
Blog Post:
SQL Server: Tuning your SMO Application for great performance - PART 1 (featured at TechED)
mwories
I'm ramping up for TechED 2005 (Both USA and Europe) and will be giving a couple of talks on SMO. This is a repost of an article from SqlJunkies, as I am still moving these blog entries to MSDN. Ping me if you are visiting TechED and are interested in certain SMO topics. Unlike SQL-DMO...
on
22 Apr 2005
Page 1 of 1 (13 items)