Browse by Tags

Tagged Content List
  • Blog Post: SMO Sample: Enable TCP/IP Server protocol of SQL Server 2005

    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...
  • Blog Post: SMO Sample: Which SQL Server version is supported by the property?

    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...
  • Blog Post: SMO Sample: Create and Start a Job

    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 ...
  • Blog Post: SMO Sample: Backup database to Mirrors

    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" ;...
  • Blog Post: SMO Sample: Partitions

    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...
  • Blog Post: SMO Sample: Transfer

    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...
  • Blog Post: SMO Sample: Table column default constraint

    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...
  • Blog Post: Scripting in Microsoft SQL Server 2005 Web Cast Resources

    This article contains extra information with regard to the web cast "Scripting in Microsoft SQL Server 2005 " that was held on 6/22/2005 9:30-11:00 PST. Q&A Log Question: Is sql server management studio part of standard edition ? Answer: Yes. Every edition except for Express Question: Is...
  • Blog Post: DMO FAQ

    Q: Is SQL-DMO still supported with SQL Server 2005? A: Yes, SQL-DMO will be fully supported (albeit officially deprecated), however it will not be able to make use of any new SQL Server 2005 features. SQL-DMO will be available through a special 'backward compatibility redist' (filename = SQLServer2005_BC...
  • Blog Post: SMO FAQ

    Q: With which SQL Server versions is SMO compatible? A: SQL Server 2000, and SQL Server 2005. Q: Is there going to be a redist for SMO? A: Yes, is a combined redist that contains, SMO, RMO, AMO. NMO, DTS Runtime. This is downloadable from the web: http://www.microsoft.com/downloads/details.aspx?FamilyId...
  • Blog Post: Index for SQL Server related articles

    I'm starting to post articles around SMO and other topics, like WMI, SQLCMD, and other areas. This index will be helpful to get quick access to these posts. Hope you like the posts. If you do (or don't), please let me know! SMO and DMO Tuning your SMO Application Part 1 Tuning your SMO Application...
Page 1 of 1 (11 items)