<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-14236385</id><updated>2011-09-10T03:34:43.234-07:00</updated><title type='text'>Mohamad Shehadeh's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-14236385.post-3203698082965442605</id><published>2009-12-10T05:28:00.000-08:00</published><updated>2009-12-10T05:45:43.317-08:00</updated><title type='text'>Sophisticated Database Conversion and Data Migration.</title><content type='html'>&lt;span style="color:#3333ff;"&gt;Sophisticated Database Conversion and Data Migration.Full Convert Enterprise is the easiest and most feature-rich database converter on the market. It will effortlesly migrate your database tables with all the data, create indexes, foreign keys - and more. When you do need the power, you will find unmatched customization features, conversion scheduler for recurring migrations, built-in database explorer, extremely powerful command-line interface, character set conversion, global datatype translation rules, support for SQL expressions to transform data on the fly - and much much more.&lt;/span&gt;&lt;br /&gt;&lt;a onmouseover="Tip('Access is supported both as source and target database. We support all versions, including Access 2007.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;Microsoft Access&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('All dBase (DBF) versions are supported as a source database and can be converted to any of the databases on the right.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;dBase&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('All FoxPro (DBF) versions are supported as a source database and can be converted to any of the databases on the right.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;FoxPro&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('Excel is supported both as source and target database. We support all versions, including Excel 2007 - and you do not need to have Excel installed.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;Microsoft Excel&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('Interbase is supported both as source and target database. We support all versions (files with GDB and IB extension).')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;Interbase&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('Firebird (FDB files) is supported both as source and target database.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;Firebird&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('Lotus 1-2-3 (WK3 and WK4 files) is supported as a source database and can be converted to any of the databases on the right.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;Lotus 1-2-3&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('MySQL is supported both as source and target database. We support all versions, including MySQL 5.x.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;MySQL&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('When you access your database using ODBC, getting its data converted is easy using Full Convert. Just select a proper DSN.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;ODBC&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('Oracle is supported both as source and target database. We support all versions, including Oracle 11g.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;Oracle&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('Paradox is supported as a source database and can be converted to any of the databases on the right. If you have encrypted Paradox tables, you will need to decrypt them before conversion.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;Paradox&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('PostgreSQL is supported both as source and target database.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;PostgreSQL&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('SQL Server is supported both as source and target database. We support all versions, including SQL Server 2008.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;SQL Server&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('SQL Server Compact Edition (SQLCE or SQL CE) is supported both as source and target database.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;SQL Server Compact&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('Delimited text files (CSV, TSV etc.) are supported both as source and target database. We offer great deal of flexibility in handling text files, including choosing the delimiter.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;Delimited text files (CSV)&lt;/a&gt;&lt;br /&gt;&lt;a onmouseover="Tip('XML is supported as a source database and can be converted to any of the databases on the right. For now, though, we require you to match specified XML format. In the future we will analyze XML files and provide advanced mapping.')" onclick="return false" onmouseout="UnTip()" href="http://www.spectralcore.com/fullconvert/#"&gt;XML&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Handles databases of unlimited size. Literally.&lt;br /&gt;Full Unicode support&lt;br /&gt;Creates all data, indexes and foreign keys&lt;br /&gt;Data throughput of thousands of records/sec&lt;br /&gt;Easily handles hundreds of gigabytes of data&lt;br /&gt;Advanced command-line support&lt;br /&gt;Built-in scheduler for recurring conversions&lt;br /&gt;BLOB and MEMO fields are fully supported&lt;br /&gt;Runs on all Windows versions&lt;br /&gt;&lt;/span&gt;&lt;a class="more" href="http://www.spectralcore.com/fullconvert/whatsnew5.php"&gt;See what's new in version 5&lt;/a&gt;&lt;br /&gt;&lt;a class="more" href="http://www.spectralcore.com/fullconvert/whatsnew4.php"&gt;See what's new in version 4&lt;/a&gt;&lt;br /&gt;&lt;a class="more" href="http://www.spectralcore.com/fullconvert/features.php"&gt;All features&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.spectralcore.com/order.php?product=fullconvert"&gt;&lt;/a&gt;&lt;a href="http://www.spectralcore.com/dlsubscribe.php?product=fullconvert"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-3203698082965442605?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/3203698082965442605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=3203698082965442605' title='36 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/3203698082965442605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/3203698082965442605'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2009/12/sophisticated-database-conversion-and.html' title='Sophisticated Database Conversion and Data Migration.'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>36</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-7868245376326737106</id><published>2009-12-10T05:03:00.000-08:00</published><updated>2009-12-10T05:06:09.441-08:00</updated><title type='text'>Complete translation of your whole SQL Server database</title><content type='html'>&lt;span style="color:#3333ff;"&gt;Easily migrate all your database objects:&lt;br /&gt;Tables, Indexes, Constraints&lt;br /&gt;Views&lt;br /&gt;Procedures&lt;br /&gt;Functions&lt;br /&gt;Triggers&lt;br /&gt;Table data, including memo and binary fields &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Using SQL Tran, you are using a tool which manages near 100% fully automated translation of your database logic. Of course, you can modify the translated statements and maintain your customizations in a saved project. For many databases, our tool does a full 100% translation with no modifications needed!&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;For more details visit : &lt;a href="http://www.spectralcore.com/sqltran/"&gt;http://www.spectralcore.com/sqltran/&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-7868245376326737106?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/7868245376326737106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=7868245376326737106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/7868245376326737106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/7868245376326737106'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2009/12/complete-translation-of-your-whole-sql.html' title='Complete translation of your whole SQL Server database'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-8189605213903425511</id><published>2008-05-01T03:41:00.000-07:00</published><updated>2008-05-01T03:43:59.890-07:00</updated><title type='text'>Microsoft SharePoint Administration Toolkit released</title><content type='html'>The SharePoint product team has released the first version of the Microsoft SharePoint Administration Toolkit which is supported on MOSS and WSS.&lt;br /&gt;&lt;br /&gt;Get all the details at the SharePoint team's blog: &lt;a href="http://blogs.msdn.com/sharepoint/archive/2008/04/30/announcing-the-first-release-of-the-microsoft-sharepoint-administration-toolkit.aspx"&gt;http://blogs.msdn.com/sharepoint/archive/2008/04/30/announcing-the-first-release-of-the-microsoft-sharepoint-administration-toolkit.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-8189605213903425511?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/8189605213903425511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=8189605213903425511' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/8189605213903425511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/8189605213903425511'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2008/05/microsoft-sharepoint-administration.html' title='Microsoft SharePoint Administration Toolkit released'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-4980451449033289472</id><published>2008-04-21T13:35:00.000-07:00</published><updated>2008-04-21T13:44:31.875-07:00</updated><title type='text'>The STSADM.EXE Command Line Utility</title><content type='html'>&lt;span style="color:#6666cc;"&gt;WSS ships with a handy command-line utility named STSADM.EXE. This utility allows you to run interactive commands from the Windows command line and to script batch files that accomplish administrative tasks such as creating, backing up, and restoring site collections. When you run this utility from the command line or from a batch file, you must pass the –o parameter followed by one of the supported operations. Here’s an example of a command line instruction to create a new site collection at a specific URL.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#6666cc;"&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;STSADM.EXE –o CreateSite –url &lt;/span&gt;&lt;a href="http://mshehadeh/sites/blog"&gt;&lt;span style="color:#cc0000;"&gt;http://mshehadeh/sites/blog&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;-ownerlogin mshehadeh\admin&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;-owneremail &lt;/span&gt;&lt;a href="mailto:mail@mshehadeh.com"&gt;&lt;span style="color:#cc0000;"&gt;mail@mshehadeh.com&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;-sitetemplate STS#0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#6666cc;"&gt;&lt;br /&gt;Note that this example has introduced line breaks between the parameters to make things more readable. However, you cannot actually use line breaks between the parameters when running the STSADM utility from the command line or from a batch file.&lt;br /&gt;Keep in mind that the installation of WSS adds the STSADM.EXE utility to a WSS system directory deep within the Windows Program Files directory. If you want to be able to call this utility directly from the command line on your development workstation, you should add the following path to your configured System path.&lt;br /&gt;c:\program files\common files\microsoft shared\web server extensions\12\bin\&lt;br /&gt;This System path is known as 12HIVE&lt;br /&gt;&lt;br /&gt;When you write a batch file, you should also assume that it might be run on a machine that does not have the proper System path configured. Therefore, you should write batch files that explicitly specify the location of the STSADM.EXE utility.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;@SET STSADM="c:\program files\common files\microsoft shared\&lt;br /&gt;web server extensions\12\bin\stsadm"&lt;br /&gt;%STSADM% –o CreateSite –url &lt;/span&gt;&lt;a href="http://mshehadeh/sites/blog"&gt;&lt;span style="color:#cc0000;"&gt;http://mshehadeh/sites/blog&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;-ownerlogin mshehadeh\admin&lt;br /&gt;-owneremail &lt;/span&gt;&lt;a href="mailto:mail@mshehadeh.com"&gt;&lt;span style="color:#cc0000;"&gt;mail@mshehadeh.com&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;-sitetemplate STS#0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once again, the line breaks in the preceding example are only for readability. You will want to remove them when writing an actual batch file.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#6666cc;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-4980451449033289472?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/4980451449033289472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=4980451449033289472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/4980451449033289472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/4980451449033289472'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2008/04/stsadmexe-command-line-utility.html' title='The STSADM.EXE Command Line Utility'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-5038898322588127933</id><published>2008-04-21T12:21:00.000-07:00</published><updated>2008-04-21T12:34:09.998-07:00</updated><title type='text'>Free Sharepoint Hosting</title><content type='html'>&lt;span style="color:#ff6600;"&gt;You want a free sharepoint hosting?&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.freesharepoint2007.com/uddi/register.aspx"&gt;TRY IT FREE&lt;br /&gt;&lt;/a&gt;&lt;span style="color:#6666cc;"&gt;No Time Limit&lt;br /&gt;5 MB Disk Space&lt;br /&gt;5 Users&lt;/span&gt;&lt;br /&gt;&lt;a title="Order Free SharePoint Hosting" href="http://www.freesharepoint2007.com/uddi/register.aspx"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-5038898322588127933?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/5038898322588127933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=5038898322588127933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/5038898322588127933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/5038898322588127933'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2008/04/free-sharepoint-hosting.html' title='Free Sharepoint Hosting'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-3106797127991774416</id><published>2008-04-21T12:10:00.000-07:00</published><updated>2008-04-21T12:19:28.920-07:00</updated><title type='text'>SharePoint Training Tutorials</title><content type='html'>&lt;span style="color:#ff6600;"&gt;&lt;strong&gt;Step by Step How To Instructions&lt;/strong&gt;&lt;/span&gt;&lt;a title="Free 30 Day Trial on all SharePoint Plans" href="http://www.frontpages-web-hosting.net/sharepoint-hosting/free-sharepoint-tutorials.asp"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#6633ff;"&gt;In these SharePoint screencast tutorials, get step by step instructions on all the features included in SharePoint hosting and how to optimize your site. The tutorials cover topics from Alerts and Creating Web Parts to Creating Meetings Sites and Wikis.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#6633ff;"&gt;Go ahead and try it at &lt;a href="http://www.frontpages-web-hosting.net/sharepoint-hosting/free-sharepoint-tutorials.asp"&gt;http://www.frontpages-web-hosting.net/sharepoint-hosting/free-sharepoint-tutorials.asp&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-3106797127991774416?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/3106797127991774416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=3106797127991774416' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/3106797127991774416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/3106797127991774416'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2008/04/sharepoint-training-tutorials.html' title='SharePoint Training Tutorials'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-2018104593356587849</id><published>2008-04-19T06:57:00.000-07:00</published><updated>2008-04-19T07:02:17.009-07:00</updated><title type='text'>Optimization of Virtual Machine Size and Performance</title><content type='html'>&lt;span style="color:#6666cc;"&gt;While googling for a software that help me on optimizing my virtual machines size,i found a great software named vOptimizer.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#6666cc;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#6666cc;"&gt;vOptimizer is an advanced optimization solution that quickly and easily reduces a virtual machines virtual hard drive to the smallest size possible while optimizing Windows guest operating systems for speed and performance. vOptimizer 4.0 offers many new functions for enterprise level customers while improving the interface and ease of operation for smaller, desktop oriented users. vOptimizer Desktop Edition enables unlimited optimizations of local VMs while Network Edition enables unlimited optimizations of VMs located anywhere across the network as well as scheduled optimizations.  vOptimizer FreeWare is essentially Desktop Edition with a number of features disabled and additional popup messages&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.vizioncore.com/vOptimizerFreewareRedirect.html"&gt;Download vOptimizer&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-2018104593356587849?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/2018104593356587849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=2018104593356587849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/2018104593356587849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/2018104593356587849'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2008/04/optimization-of-virtual-machine-size.html' title='Optimization of Virtual Machine Size and Performance'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-7926238210706549205</id><published>2008-04-19T05:24:00.000-07:00</published><updated>2008-04-19T05:30:30.747-07:00</updated><title type='text'>How to Create a MOSS 2007 VPC Image</title><content type='html'>As SharePoint-y guys - virtualization is a *must* for us.&lt;br /&gt;I found a great article about creating a sharepoint Virtual PC Image,this is a complete step by step article that shows you  &lt;a href="http://www.pptspaces.com/sharepointreporterblog/Lists/Posts/Post.aspx?ID=28"&gt;How to Create a MOSS 2007 VPC Image&lt;/a&gt;&lt;br /&gt;Enjoy it&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-7926238210706549205?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/7926238210706549205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=7926238210706549205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/7926238210706549205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/7926238210706549205'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2008/04/how-to-create-moss-2007-vpc-image.html' title='How to Create a MOSS 2007 VPC Image'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-8290180550124633089</id><published>2008-04-19T05:14:00.000-07:00</published><updated>2008-04-19T05:44:38.274-07:00</updated><title type='text'>I am back</title><content type='html'>I am back to writing .  i will be writing about Windows Sharepoint Services 3.0 (WSS 3.0), and Office Sharepoint 2007 (MOSS 2007).,&lt;br /&gt;I will share with you some resources and articles about WSS 3.0 and MOSS 2007&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-8290180550124633089?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/8290180550124633089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=8290180550124633089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/8290180550124633089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/8290180550124633089'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2008/04/i-am-back.html' title='I am back'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-160286030402918688</id><published>2007-09-27T04:57:00.000-07:00</published><updated>2007-09-27T05:11:22.403-07:00</updated><title type='text'>Restoring SQL Server 2005 Suspect Database</title><content type='html'>&lt;span style="color:#333399;"&gt;I had a SQL Server 2005 database in suspect mode,so i couldn't work on transaction until i repaired,while i am searching on the internet to resolve this problem i found an new Database status called Emergency introduced in SQL Server 2005.&lt;br /&gt;This mode can change the database from Suspect mode to Emergency mode, so that you can retrieve the data in read only mode.&lt;br /&gt;Please follow the following steps to change the database status from suspect to emergency than to it's normal state:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;EXEC sp_resetstatus 'DBname'&lt;br /&gt;&lt;br /&gt;ALTER DATABASE DBname SET EMERGENCY&lt;br /&gt;&lt;br /&gt;DBCC checkdb('DBname')&lt;br /&gt;&lt;br /&gt;ALTER DATABASE DBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE&lt;br /&gt;&lt;br /&gt;DBCC CheckDB ('DBname', REPAIR_ALLOW_DATA_LOSS)&lt;br /&gt;&lt;br /&gt;ALTER DATABASE DBname SET MULTI_USER&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#333399;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;I hope that will help you to get your database working&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-160286030402918688?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/160286030402918688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=160286030402918688' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/160286030402918688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/160286030402918688'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2007/09/restoring-sql-server-2005-suspect.html' title='Restoring SQL Server 2005 Suspect Database'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-570097604070131104</id><published>2007-09-04T02:17:00.000-07:00</published><updated>2007-09-05T23:36:30.313-07:00</updated><title type='text'>FTP Put file using t-sql</title><content type='html'>&lt;span style="color:#333399;"&gt;I have to use a stored procedure which will send/Receive text file&lt;br /&gt;from/to a server by using FTP.&lt;br /&gt;&lt;br /&gt;So i googled on the net and i found a very interesting stored procedure written by &lt;a href="http://www.nigelrivett.net/FTP/s_ftp_PutFile.html"&gt;Nigel Rivett &lt;/a&gt;&lt;br /&gt;that will upload a file from the database.&lt;br /&gt;But before using this stored procedure on SQL Server 2005,XP_CMDSHELL must be enabled,&lt;br /&gt;because it's disabled by default on SQL Server 2005 for security reasons.&lt;br /&gt;There are two ways to enable this option: Surface Area Configuration tool or sp_configure.&lt;br /&gt;Enabling this option via Surface Area Configuration tool is rather straight forward.&lt;br /&gt;Here is the instructions to enable xp_cmdshell in SQL Server 2005 via Surface Area Configuration tool:&lt;br /&gt;&lt;br /&gt;1. Click the Start button.&lt;br /&gt;&lt;br /&gt;2. Select All Programs.&lt;br /&gt;&lt;br /&gt;3. Navigate to the Microsoft SQL Server 2005 folder.&lt;br /&gt;&lt;br /&gt;4. On the flyout, mouseover Configuration Tools.&lt;br /&gt;&lt;br /&gt;5. Select SQL Server Surface Area Configuration.&lt;br /&gt;&lt;br /&gt;6. The SQL Server 2005 Surface Area Configuration window will appear.&lt;br /&gt;&lt;br /&gt;7. At the bottom of the window, select Surface Area Configuration for Features.&lt;br /&gt;&lt;br /&gt;8. In the left pane, under Database Engine, select xp_cmdshell.&lt;br /&gt;&lt;br /&gt;9. Check the Enable xp_cmdshell checkbox.&lt;br /&gt;&lt;br /&gt;10. Click OK.&lt;br /&gt;&lt;br /&gt;11. Close the SQL Server 2005 Surface Area Configuration window.&lt;br /&gt;&lt;br /&gt;Here is the script to enable xp_cmdshell in SQL Server 2005 via sp_configure:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;EXEC master.dbo.sp_configure 'show advanced options', 1&lt;br /&gt;&lt;br /&gt;RECONFIGURE&lt;br /&gt;&lt;br /&gt;EXEC master.dbo.sp_configure 'xp_cmdshell', 1&lt;br /&gt;&lt;br /&gt;RECONFIGURE&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;-- FTP Put file using t-sql.&lt;br /&gt;-- Author Nigel Rivett&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;This needs a work directory to create a FTP command file to execute.&lt;br /&gt;In a multi-user system include the spid in the filename to make it unique for the connection.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;if exists (select * from sysobjects where id = object_id(N'[dbo].[s_ftp_PutFile]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)&lt;br /&gt;drop procedure [dbo].[s_ftp_PutFile]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Create procedure s_ftp_putfile&lt;br /&gt;@FTPServer varchar(128) ,&lt;br /&gt;@FTPUser varchar(128) ,&lt;br /&gt;@FTPPWD varchar(128) ,&lt;br /&gt;@FTPPath varchar(128) ,&lt;br /&gt;@FTPFileName varchar(128) ,&lt;br /&gt;@SourcePath varchar(128) ,&lt;br /&gt;@SourceFile varchar(128) ,&lt;br /&gt;@workdir varchar(128)&lt;br /&gt;as&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;declare @cmd varchar(1000)&lt;br /&gt;declare @workfilename varchar(128)&lt;br /&gt;&lt;br /&gt;/* usage:&lt;br /&gt;exec s_ftp_putfile&lt;br /&gt;@FTPServer = 'ftpserver' ,&lt;br /&gt;@FTPUser = 'user' ,&lt;br /&gt;@FTPPWD = 'password' ,&lt;br /&gt;@FTPPath = 'path/' ,&lt;br /&gt;@FTPFileName = 'test.txt' ,&lt;br /&gt;@SourcePath = 'c:\' ,&lt;br /&gt;@SourceFile = 'test.txt' ,&lt;br /&gt;@workdir = 'c:\temp\'&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;select @workfilename = 'ftpcmd.txt'&lt;br /&gt;&lt;br /&gt;-- deal with special characters for echo commands&lt;br /&gt;select @FTPServer = replace(replace(replace(@FTPServer, '', '^'),'&lt;','^&lt;'),'&gt;','^&gt;')&lt;br /&gt;select @FTPUser = replace(replace(replace(@FTPUser, '', '^'),'&lt;','^&lt;'),'&gt;','^&gt;')&lt;br /&gt;select @FTPPWD = replace(replace(replace(@FTPPWD, '', '^'),'&lt;','^&lt;'),'&gt;','^&gt;')&lt;br /&gt;select @FTPPath = replace(replace(replace(@FTPPath, '', '^'),'&lt;','^&lt;'),'&gt;','^&gt;')&lt;br /&gt;&lt;br /&gt;select @cmd = 'echo ' + 'open ' + @FTPServer&lt;br /&gt;+ ' &gt; ' + @workdir + @workfilename&lt;br /&gt;exec master..xp_cmdshell @cmd&lt;br /&gt;select @cmd = 'echo ' + @FTPUser&lt;br /&gt;+ '&gt;&gt; ' + @workdir + @workfilename&lt;br /&gt;exec master..xp_cmdshell @cmd&lt;br /&gt;select @cmd = 'echo ' + @FTPPWD&lt;br /&gt;+ '&gt;&gt; ' + @workdir + @workfilename&lt;br /&gt;exec master..xp_cmdshell @cmd&lt;br /&gt;select @cmd = 'echo ' + 'put ' + @SourcePath + @SourceFile + ' ' + @FTPPath + @FTPFileName&lt;br /&gt;+ ' &gt;&gt; ' + @workdir + @workfilename&lt;br /&gt;exec master..xp_cmdshell @cmd&lt;br /&gt;select @cmd = 'echo ' + 'quit'&lt;br /&gt;+ ' &gt;&gt; ' + @workdir + @workfilename&lt;br /&gt;exec master..xp_cmdshell @cmd&lt;br /&gt;&lt;br /&gt;select @cmd = 'ftp -s:' + @workdir + @workfilename&lt;br /&gt;&lt;br /&gt;create table #a (id int identity(1,1), s varchar(1000))&lt;br /&gt;insert #a&lt;br /&gt;exec master..xp_cmdshell @cmd&lt;br /&gt;&lt;br /&gt;select id, ouputtmp = s from #a&lt;br /&gt;&lt;br /&gt;go&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-570097604070131104?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/570097604070131104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=570097604070131104' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/570097604070131104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/570097604070131104'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2007/09/ftp-put-file-using-t-sql.html' title='FTP Put file using t-sql'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-8521190725496618572</id><published>2007-08-02T22:56:00.000-07:00</published><updated>2007-08-02T23:06:38.838-07:00</updated><title type='text'>Converting the database mirroring from High Availability to High Performance</title><content type='html'>&lt;span style="color:#3333ff;"&gt;&lt;span style="color:#333399;"&gt;In the previous article i showed you how to configure database mirroring using the high availability configuration through a SQLCMD master script.&lt;br /&gt;What if we want to change the configuration from high availability mode to high performance mode,we will need to clean the configuration and reconfigure it again?&lt;br /&gt;The answer is no,we can convert the configuration.&lt;br /&gt;All what we need to do is to set both the witness and the safety off&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;-- ConvertToHighPerf.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;/*========================================================&lt;br /&gt;File: ConvertToHighPerf.sql&lt;br /&gt;&lt;br /&gt;Summary: Change the High Availability configuration&lt;br /&gt;over to High Performance.&lt;br /&gt;Turn off the witness, turn off safety!&lt;br /&gt;&lt;br /&gt;Date: August 2007&lt;br /&gt;==========================================================*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;:SETVAR PrincipalServer MSHEHADEHVPC\SQLDev01&lt;br /&gt;:SETVAR MirrorServer MSHEHADEHVPC\SQLDev02&lt;br /&gt;:SETVAR Database2Mirror AdventureWorksDW&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;:ON ERROR EXIT&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;:CONNECT $(PrincipalServer)&lt;br /&gt;&lt;br /&gt;ALTER DATABASE $(Database2Mirror)&lt;br /&gt;SET WITNESS OFF&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;ALTER DATABASE $(Database2Mirror)&lt;br /&gt;SET SAFETY OFF&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;SELECT DATABASEPROPERTYEX(N'$(Database2Mirror)', N'Status')&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;-- Returns ONLINE&lt;/span&gt;&lt;br /&gt;SELECT db_name(sd.[database_id]) AS [Database Name],&lt;br /&gt;sd.mirroring_guid,&lt;br /&gt;sd.mirroring_state,&lt;br /&gt;sd.mirroring_state_desc,&lt;br /&gt;sd.mirroring_partner_name,&lt;br /&gt;sd.mirroring_witness_name,&lt;br /&gt;sd.mirroring_witness_state,&lt;br /&gt;sd.mirroring_witness_state_desc,&lt;br /&gt;sd.mirroring_role,&lt;br /&gt;sd.mirroring_role_desc,&lt;br /&gt;sd.mirroring_role_sequence,&lt;br /&gt;sd.mirroring_safety_level,&lt;br /&gt;sd.mirroring_safety_level_desc,&lt;br /&gt;sd.mirroring_safety_sequence,&lt;br /&gt;sd.mirroring_failover_lsn&lt;br /&gt;FROM sys.database_mirroring AS sd&lt;br /&gt;WHERE sd.[database_id] = db_id(N'$(Database2Mirror)')&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;:CONNECT $(MirrorServer)&lt;br /&gt;SELECT DATABASEPROPERTYEX(N'$(Database2Mirror)', N'Status') -- Returns RESTORING&lt;br /&gt;SELECT db_name(sd.[database_id]) AS [Database Name],&lt;br /&gt;sd.mirroring_guid,&lt;br /&gt;sd.mirroring_state,&lt;br /&gt;sd.mirroring_state_desc,&lt;br /&gt;sd.mirroring_partner_name,&lt;br /&gt;sd.mirroring_witness_name,&lt;br /&gt;sd.mirroring_witness_state,&lt;br /&gt;sd.mirroring_witness_state_desc,&lt;br /&gt;sd.mirroring_role,&lt;br /&gt;sd.mirroring_role_desc,&lt;br /&gt;sd.mirroring_role_sequence,&lt;br /&gt;sd.mirroring_safety_level,&lt;br /&gt;sd.mirroring_safety_level_desc,&lt;br /&gt;sd.mirroring_safety_sequence,&lt;br /&gt;sd.mirroring_failover_lsn&lt;br /&gt;FROM sys.database_mirroring AS sd&lt;br /&gt;WHERE sd.[database_id] = db_id(N'$(Database2Mirror)')&lt;br /&gt;go&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-8521190725496618572?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/8521190725496618572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=8521190725496618572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/8521190725496618572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/8521190725496618572'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2007/08/converting-database-mirroring-from-high.html' title='Converting the database mirroring from High Availability to High Performance'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-3307877221292752466</id><published>2007-08-01T22:27:00.001-07:00</published><updated>2007-08-01T23:22:05.857-07:00</updated><title type='text'>Configuring and Implementing Database Mirroring using SQLCMD</title><content type='html'>&lt;span style="color:#333399;"&gt;This article configures a database (uses AdventureWorksDW) for database mirroring – using the high availability configuration through a SQLCMD master script. SQLCMD replaces OSQL in SQL Server 2005 for better command-line automation by offering many new features including parameterization and ability to connect to different servers – all within one script. The true power can be seen by the fact that you can create complex multi-server scripts all within one master script. This script contains the steps necessary to setup mirroring through Transact-SQL. You will execute this script through the SQLCMD mode supported in SQL Server Management Studio. Please be sure to ONLY review the commands and their syntax, DO NOT EXECUTE any of the steps until the end – without the parameters set properly, this script will not execute correctly. This configuration is the High Availability configuration.&lt;br /&gt;&lt;br /&gt;The below script (Database2Mirror.sql) is a SQLCMD script and by default, SQLCMD mode is not enabled. Enable SQLCMD command mode by choosing SQLCMD Mode from the Query menu (make sure to remember the icon shown in the drop-down menu since you could choose to use this instead). You can also toggle this mode off and on by using the SQLCMD mode icon in the toolbar. If you’re not sure of what an icon is, remember to use tool tips by hovering over an icon. Once you’ve enabled SQLCMD Mode, notice how your script changes. All SQLCMD lines are highlighted in gray.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;-- Database2Mirror.sql&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;/*=============================================&lt;br /&gt;File: Database2Mirror.sql&lt;br /&gt;&lt;br /&gt;Summary: Setup the database for Mirroring - High Availability.&lt;br /&gt;&lt;br /&gt;Date: August 2007&lt;br /&gt;&lt;br /&gt;===============================================*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;:SETVAR PrincipalServer MSHEHADEHVPC\SQLDev01&lt;br /&gt;:SETVAR MirrorServer MSHEHADEHVPC\SQLDev02&lt;br /&gt;:SETVAR WitnessServer MSHEHADEHVPC\SQLExpress&lt;br /&gt;:SETVAR Database2Mirror AdventureWorksDW&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;:ON ERROR EXIT&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;:CONNECT $(PrincipalServer)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;-- Mirroring ONLY supports the FULL Recovery Model&lt;br /&gt;&lt;/span&gt;ALTER DATABASE $(Database2Mirror)&lt;br /&gt;SET RECOVERY FULL&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;USE $(Database2Mirror)&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;CREATE ENDPOINT Mirroring&lt;br /&gt;STATE=STARTED&lt;br /&gt;AS TCP (LISTENER_PORT=5091)&lt;br /&gt;FOR DATABASE_MIRRORING (ROLE=ALL)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;:CONNECT $(MirrorServer)&lt;br /&gt;&lt;br /&gt;CREATE ENDPOINT Mirroring&lt;br /&gt;STATE=STARTED&lt;br /&gt;AS TCP (LISTENER_PORT=5092)&lt;br /&gt;FOR DATABASE_MIRRORING (ROLE=ALL)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;:CONNECT $(WitnessServer)&lt;br /&gt;&lt;br /&gt;CREATE ENDPOINT Mirroring&lt;br /&gt;STATE=STARTED&lt;br /&gt;AS TCP (LISTENER_PORT=5090)&lt;br /&gt;FOR DATABASE_MIRRORING (ROLE=WITNESS)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;:CONNECT $(PrincipalServer)&lt;br /&gt;&lt;br /&gt;BACKUP DATABASE $(Database2Mirror)&lt;br /&gt;TO DISK = 'C:\MSHEHADEHVPC\Mirroring\$(Database2Mirror).bak'&lt;br /&gt;WITH INIT&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;:CONNECT $(MirrorServer)&lt;br /&gt;&lt;br /&gt;DECLARE @InstanceName sql_variant,&lt;br /&gt;@InstanceDir sql_variant,&lt;br /&gt;@SQLDataRoot nvarchar(512),&lt;br /&gt;@ExecStr nvarchar(max)&lt;br /&gt;&lt;br /&gt;SELECT @InstanceName = ISNULL(SERVERPROPERTY('InstanceName'), 'MSSQLServer')&lt;br /&gt;&lt;br /&gt;EXECUTE master.dbo.xp_regread 'HKEY_LOCAL_MACHINE',&lt;br /&gt;'SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL',&lt;br /&gt;@InstanceName, @InstanceDir OUTPUT&lt;br /&gt;&lt;br /&gt;SELECT @ExecStr = 'EXECUTE master.dbo.xp_regread '&lt;br /&gt;+ '''HKEY_LOCAL_MACHINE'', '&lt;br /&gt;+ '''SOFTWARE\Microsoft\Microsoft SQL Server\'&lt;br /&gt;+ convert(varchar, @InstanceDir)&lt;br /&gt;+ '\Setup'', ''SQLDataRoot'', @SQLDataRoot OUTPUT'&lt;br /&gt;&lt;br /&gt;EXEC master.dbo.sp_executesql @ExecStr&lt;br /&gt;, N'@SQLDataRoot nvarchar(512) OUTPUT'&lt;br /&gt;, @SQLDataRoot OUTPUT&lt;br /&gt;&lt;br /&gt;IF @SQLDataRoot IS NULL&lt;br /&gt;BEGIN&lt;br /&gt;RAISERROR ('Did not find the correct SQL Data Root Directory. Cannot proceed. Databases backed up but not yet restored.', 16, -1)&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;CREATE TABLE #BackupFileList&lt;br /&gt;( LogicalName sysname NULL&lt;br /&gt;, PhysicalName sysname NULL&lt;br /&gt;, [Type] char(1)&lt;br /&gt;, FileGroupName sysname NULL&lt;br /&gt;, Size bigint&lt;br /&gt;, MaxSize bigint&lt;br /&gt;, FileId smallint&lt;br /&gt;, CreateLSN numeric(25,0)&lt;br /&gt;, DropLSN numeric(25,0)&lt;br /&gt;, UniqueId uniqueidentifier&lt;br /&gt;, ReadOnlyLSN numeric(25,0)&lt;br /&gt;, ReadWriteLSN numeric(25,0)&lt;br /&gt;, BackupSizeInBytes bigint&lt;br /&gt;, SourceBlockSize bigint&lt;br /&gt;, FileGroupId smallint&lt;br /&gt;, LogGroupGUID uniqueidentifier&lt;br /&gt;, DifferentialBaseLSN numeric(25,0)&lt;br /&gt;, DifferentialBaseGUID uniqueidentifier&lt;br /&gt;, IsReadOnly bit&lt;br /&gt;, IsPresent bit&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;INSERT #BackupFileList&lt;br /&gt;EXEC('LOAD FILELISTONLY FROM DISK = ''C:\MSHEHADEHVPC\Mirroring\$(Database2Mirror).bak''')&lt;br /&gt;&lt;br /&gt;UPDATE #BackupFileList&lt;br /&gt;SET PhysicalName&lt;br /&gt;= @SQLDataRoot&lt;br /&gt;+ N'\Data\'&lt;br /&gt;+ REVERSE(SUBSTRING(REVERSE(PhysicalName)&lt;br /&gt;, 1, PATINDEX('%\%', REVERSE(PhysicalName)) -1))&lt;br /&gt;&lt;br /&gt;DECLARE @LogicalName sysname&lt;br /&gt;, @PhysicalName sysname&lt;br /&gt;&lt;br /&gt;DECLARE FileListCursor CURSOR FAST_FORWARD FOR&lt;br /&gt;SELECT LogicalName, PhysicalName&lt;br /&gt;FROM #BackupFileList&lt;br /&gt;&lt;br /&gt;OPEN FileListCursor&lt;br /&gt;&lt;br /&gt;FETCH NEXT FROM FileListCursor INTO @LogicalName, @PhysicalName&lt;br /&gt;&lt;br /&gt;SELECT @ExecStr = N'RESTORE DATABASE $(Database2Mirror)' +&lt;br /&gt;N' FROM DISK = ''C:\MSHEHADEHVPC\Mirroring\$(Database2Mirror).bak''' +&lt;br /&gt;N' WITH MOVE ''' + @LogicalName + N''' TO ''' + @PhysicalName + N''''&lt;br /&gt;&lt;br /&gt;FETCH NEXT FROM FileListCursor INTO @LogicalName, @PhysicalName&lt;br /&gt;&lt;br /&gt;WHILE @@FETCH_STATUS &lt;&gt; -1&lt;br /&gt;BEGIN&lt;br /&gt;SELECT @ExecStr = @ExecStr + N', MOVE ''' + @LogicalName&lt;br /&gt;+ ''' TO ''' + @PhysicalName + ''''&lt;br /&gt;FETCH NEXT FROM FileListCursor INTO @LogicalName, @PhysicalName&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;-- NORECOVERY is required for Database Mirroring, replace is not.&lt;br /&gt;-- Replace is used here solely to allow repetitive use of this script.&lt;br /&gt;&lt;/span&gt;SELECT @ExecStr = @ExecStr + N' , NORECOVERY, REPLACE'&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;-- Useful for testing&lt;br /&gt;-- Only return the string and then comment out the EXEC line below.&lt;br /&gt;-- SELECT @ExecStr&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;EXEC (@ExecStr)&lt;br /&gt;&lt;br /&gt;DEALLOCATE FileListCursor&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;:CONNECT $(PrincipalServer)&lt;br /&gt;SELECT DATABASEPROPERTYEX(N'$(Database2Mirror)', N'Status') -- Returns ONLINE&lt;br /&gt;SELECT db_name(sd.[database_id]) AS [Database Name],&lt;br /&gt;sd.mirroring_guid,&lt;br /&gt;sd.mirroring_state,&lt;br /&gt;sd.mirroring_state_desc,&lt;br /&gt;sd.mirroring_partner_name,&lt;br /&gt;sd.mirroring_witness_name,&lt;br /&gt;sd.mirroring_witness_state,&lt;br /&gt;sd.mirroring_witness_state_desc,&lt;br /&gt;sd.mirroring_role,&lt;br /&gt;sd.mirroring_role_desc,&lt;br /&gt;sd.mirroring_role_sequence,&lt;br /&gt;sd.mirroring_safety_level,&lt;br /&gt;sd.mirroring_safety_level_desc,&lt;br /&gt;sd.mirroring_safety_sequence,&lt;br /&gt;sd.mirroring_failover_lsn&lt;br /&gt;FROM sys.database_mirroring AS sd&lt;br /&gt;WHERE sd.[database_id] = db_id(N'$(Database2Mirror)')&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;:CONNECT $(MirrorServer)&lt;br /&gt;SELECT DATABASEPROPERTYEX(N'$(Database2Mirror)', N'Status') -- Returns RESTORING&lt;br /&gt;SELECT db_name(sd.[database_id]) AS [Database Name],&lt;br /&gt;sd.mirroring_guid,&lt;br /&gt;sd.mirroring_state,&lt;br /&gt;sd.mirroring_state_desc,&lt;br /&gt;sd.mirroring_partner_name,&lt;br /&gt;sd.mirroring_witness_name,&lt;br /&gt;sd.mirroring_witness_state,&lt;br /&gt;sd.mirroring_witness_state_desc,&lt;br /&gt;sd.mirroring_role,&lt;br /&gt;sd.mirroring_role_desc,&lt;br /&gt;sd.mirroring_role_sequence,&lt;br /&gt;sd.mirroring_safety_level,&lt;br /&gt;sd.mirroring_safety_level_desc,&lt;br /&gt;sd.mirroring_safety_sequence,&lt;br /&gt;sd.mirroring_failover_lsn&lt;br /&gt;FROM sys.database_mirroring AS sd&lt;br /&gt;WHERE sd.[database_id] = db_id(N'$(Database2Mirror)')&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;:CONNECT $(MirrorServer)&lt;br /&gt;&lt;br /&gt;ALTER DATABASE $(Database2Mirror)&lt;br /&gt;SET PARTNER = 'TCP://MSHEHADEHVPC:5091'&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;-- SET PARTNER = 'TCP://Server.fully.qualified.dns.name:5091'&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;:CONNECT $(PrincipalServer)&lt;br /&gt;&lt;br /&gt;ALTER DATABASE $(Database2Mirror)&lt;br /&gt;SET PARTNER = 'TCP://MSHEHADEHVPC:5092'&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;-- SET PARTNER = 'TCP://Server.fully.qualified.dns.name:5092'&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;ALTER DATABASE $(Database2Mirror)&lt;br /&gt;SET WITNESS = 'TCP://MSHEHADEHVPC:5090'&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;-- SET WITNESS = 'TCP://Server.fully.qualified.dns.name:5090'&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;SELECT db_name(sd.[database_id]) AS [Database Name],&lt;br /&gt;sd.mirroring_guid,&lt;br /&gt;sd.mirroring_state,&lt;br /&gt;sd.mirroring_state_desc,&lt;br /&gt;sd.mirroring_partner_name,&lt;br /&gt;sd.mirroring_witness_name,&lt;br /&gt;sd.mirroring_witness_state,&lt;br /&gt;sd.mirroring_witness_state_desc,&lt;br /&gt;sd.mirroring_role,&lt;br /&gt;sd.mirroring_role_desc,&lt;br /&gt;sd.mirroring_role_sequence,&lt;br /&gt;sd.mirroring_safety_level,&lt;br /&gt;sd.mirroring_safety_level_desc,&lt;br /&gt;sd.mirroring_safety_sequence,&lt;br /&gt;sd.mirroring_failover_lsn&lt;br /&gt;FROM sys.database_mirroring AS sd&lt;br /&gt;WHERE sd.[database_id] = db_id(N'$(Database2Mirror)')&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;--------------------------------------------------------------------&lt;br /&gt;-- CLEAN UP SECTION&lt;br /&gt;--------------------------------------------------------------------&lt;br /&gt;-- This section will clean the database mirroring configuration&lt;br /&gt;---- Begin cleanup... &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;&lt;span style="color:#ff0000;"&gt;-- If you want to clean the database mirroring configuration &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;&lt;span style="color:#ff0000;"&gt;-- just uncomment the following section&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt;&lt;/span&gt;--:SETVAR PrincipalServer MSHEHADEHVPC\SQLDev01&lt;br /&gt;--:SETVAR MirrorServer MSHEHADEHVPC\SQLDev02&lt;br /&gt;--:SETVAR WitnessServer MSHEHADEHVPC\SQLExpress&lt;br /&gt;--:SETVAR Database2Mirror AdventureWorksDW&lt;br /&gt;--go&lt;br /&gt;--&lt;br /&gt;--:CONNECT $(PrincipalServer)&lt;br /&gt;--&lt;br /&gt;--USE master&lt;br /&gt;--GO&lt;br /&gt;--&lt;br /&gt;--SELECT * FROM sys.database_mirroring_endpoints&lt;br /&gt;--SELECT * FROM sys.endpoints&lt;br /&gt;--SELECT * FROM sys.tcp_endpoints&lt;br /&gt;--GO&lt;br /&gt;--&lt;br /&gt;--ALTER DATABASE $(Database2Mirror)&lt;br /&gt;-- SET PARTNER OFF&lt;br /&gt;--GO&lt;br /&gt;--&lt;br /&gt;--DROP ENDPOINT Mirroring&lt;br /&gt;--go&lt;br /&gt;--&lt;br /&gt;--DROP DATABASE $(Database2Mirror)&lt;br /&gt;--go&lt;br /&gt;--&lt;br /&gt;--:CONNECT $(MirrorServer)&lt;br /&gt;--&lt;br /&gt;--DROP ENDPOINT Mirroring&lt;br /&gt;--GO&lt;br /&gt;--&lt;br /&gt;--ALTER DATABASE $(Database2Mirror)&lt;br /&gt;-- SET PARTNER OFF&lt;br /&gt;--GO&lt;br /&gt;--DROP DATABASE $(Database2Mirror)&lt;br /&gt;--go&lt;br /&gt;--&lt;br /&gt;--:CONNECT $(WitnessServer)&lt;br /&gt;--&lt;br /&gt;--DROP ENDPOINT Mirroring&lt;br /&gt;--go&lt;br /&gt;--&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;------ End cleanup...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-3307877221292752466?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/3307877221292752466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=3307877221292752466' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/3307877221292752466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/3307877221292752466'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2007/08/configuring-and-implementing-database.html' title='Configuring and Implementing Database Mirroring using SQLCMD'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-115744250818806264</id><published>2006-09-05T00:40:00.000-07:00</published><updated>2006-09-05T00:48:28.203-07:00</updated><title type='text'>SQLCMD VS OSQL</title><content type='html'>&lt;span style="color:#333399;"&gt;In SQL Server 2005, Microsoft introduced a new command line utility, SQLCMD, as a replacement for osql and isql.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;In this article you will find some advantage you will gain when you use SQLCMD instead of OSQL.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;Migration from OSQL to SQLCMD will be very simple because most of the command line switches are similar,the only difference is that SQLCMD support additional switches.To see the difference between then type OSQL /? and SQLCMD /? at the command prompt. &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;1) SQLCMD supports parameterized variables&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;SQLCMD can be useful for running some SQL scripts which require you to pass different parameters specific to a certain environment.Environment variables and declared variables can be used in various places in the script The following is an example: &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;-- c:\sqlvariable.sql&lt;br /&gt;DECLARE @myVar varchar(255) &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;SET @myVar = '$(myVar)' &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;SET @myVar = @myVariable + ' ' + suser_sname() &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;PRINT @myVar &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;&lt;br /&gt;You can run it from a command prompt:&lt;br /&gt;SQLCMD -E -i"c:\sqlvariable.sql" -v myVar="You are connected as "&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Result:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;You are connected as ABOUHMEID02\Administrator&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#333399;"&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;2) !!&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#333399;"&gt;This command allows you to execute an Operating System Command on the client without having to connect and use xp_cmdshell. For example while connected to SQLCMD type !!dir&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;3) Management Studio's query editor in the SQLCMD mode&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;SQLCMD can be run both in the DOS screen as well as in the MS SQL Server 2005 Management Studio's query editor in the SQLCMD mode. If you want to use scripting, which brings in features like color coding, parsing and executing scripts, and others, this must be enabled. Enabling SQLCMD allows you to write SQL Commands as well as T-SQL Statements. You can set this in Tools Options or click the button with the Red&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;4) Performance &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;It allows you to connect to any instance of SQL Server via OLE DB (rather than via older technologies such as DB-library and ODBC, used by OSQL and ISQL, respectively) which is a much better performer&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;5) Remote Dedicated Admin Connection (DAC)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt; If you use the -A switch, you can get into a server that might otherwise be hung. You can kill an offending process and restore order to the universe - without a reboot!&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;6) SQLCMD support Customized editor&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;In SQLCMD, if you type ed, it will invoke a text editor and put the last command you run in the editor buffer. The default editor is Edit.com You can change the default editor to your own preferred editor,to do this: Open a DOS prompt; Type set sqlcmdeditor=notepad Go to sqlcmd, enter and execute a sql statement, then type ed; The notepad opens.Do the modifcations you want to do, save and close.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;7) SQLCMDINI&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;This allows you to set default parameters and even create a default query to execute on the server as soon as you connect. This helps you to automate your connection properties and to some degree your environment in command line mode. For example: Create a script file named : &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;-- c:\Init.SQL &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;-- Begin script &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;set nocount on go&lt;br /&gt;print 'You are connected to ' + rtrim(CONVERT(char(20), SERVERPROPERTY('servername'))) + ' (' + rtrim(CONVERT(char(20), SERVERPROPERTY('productversion'))) + ')' + ' ' &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;+ rtrim(CONVERT(char(30), SERVERPROPERTY('Edition'))) + ' ' &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;+ rtrim(CONVERT(char(20), SERVERPROPERTY('ProductLevel'))) &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;+ char(10)&lt;br /&gt;set nocount off go&lt;br /&gt;--End script&lt;br /&gt;In Command prompt, type: set sqlcmdini=c:\Init.SQL Here are some sample results: &lt;span style="color:#ff0000;"&gt;C:\DOCUME~1\ADMINI~1&gt;sqlcmd You are connected to ABOUHMEID02 (8.00.760) Developer Edition SP3 1&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;8) :XML [ONOFF]&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;Specifies if XML output resulting from FOR XML clause will be output as a continuous stream.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;9) :Connect server_name[ \instance_name][timeout] [ user_name[ password]]&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;From within a single script, you can connect to multiple SQL Server instances and execute commands. This allows for a great deal of automation possibilities, such as backup from one server, restore to another server. Also, you could execute a configuration change script on all servers in production.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;10) :Error &lt;filename&gt;STDERRSTDOUT&lt;/span&gt;&lt;br /&gt;There's pretty much all you need in some combination of these to gracefully deal with run-time problems. That is so much better than piping out and digging through log files! It Redirects all error output to the file specified by filename, to stderr or to stdout. The Error option can appear multiple times in a script. Error output is sent to stderr by default.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;11) :Perftrace &lt;filename&gt;STDERRSTDOUT&lt;/span&gt;&lt;br /&gt;Redirect all performance trace information to the file specified by filename, to stderr or to stdout. Performance trace output is sent to stdout by default. It lets you put your statistics (IO, TIME, ShowPlan) out to a separate file for later viewing as so not to clutter the results file output.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-115744250818806264?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/115744250818806264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=115744250818806264' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/115744250818806264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/115744250818806264'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2006/09/sqlcmd-vs-osql.html' title='SQLCMD VS OSQL'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-115744135417031682</id><published>2006-09-05T00:24:00.000-07:00</published><updated>2006-09-05T01:07:10.893-07:00</updated><title type='text'>How to create and use partition in SQL SERVER 2005:</title><content type='html'>&lt;span style="color:#333399;"&gt;Basically partitions help in improving the performance, scalability and managing of the large&lt;br /&gt;tables. As the table grows larger and larger the performance in accessing the data is affected, scalability and managing issues arises. With&lt;br /&gt;the help of partitioning a table we can achieve a great level of performance and managing of tables.&lt;br /&gt;Let us see in how we can create partitioned tables in detail. The procedure for creating a partitioned table is as follows.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;1) Creation of Filegroups&lt;/span&gt;&lt;br /&gt;Beginning with this we have to have various filegroups for the database if we need to place the partitioned tables on different filegroups. To&lt;br /&gt;create a filegroup, there are different ways one is using the Alter command and the second is using the Interface. Let us see each of them&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;a) Using the Alter Command&lt;/span&gt;&lt;br /&gt;The syntax is as follows&lt;br /&gt;ALTER DATABASE Database Name ADD FILEGROUP Filegroup name&lt;br /&gt;&lt;br /&gt;After adding a filegroup we need to add files to the filegroup. We can add one or more files. The syntax is as follows&lt;br /&gt;ALTER DATABASE Database Name&lt;br /&gt;ADD FILE&lt;br /&gt;(&lt;br /&gt;NAME = File Name,&lt;br /&gt;FILENAME = Path,&lt;br /&gt;SIZE = Size,&lt;br /&gt;MAXSIZE = Size,&lt;br /&gt;FILEGROWTH = Size&lt;br /&gt;)&lt;br /&gt;TO FILEGROUP Filegroup Name;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;b) Using the Interface&lt;/span&gt;&lt;br /&gt;The following steps show how we can create using the interface&lt;br /&gt;a) Login to the Microsoft SQL SERVER Management Studio&lt;br /&gt;b) Select the Database and right click and select properties.&lt;br /&gt;c) Select the Filegroup section and add the necessary details and click the add button.&lt;br /&gt;d) Next we will click on the Files section and add a new file and associate this file to the FG2 filegroup .&lt;br /&gt;e) Then finally click on the OK button.&lt;br /&gt;This is procedure for create a filegroup using the interface.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;2) Creation of Partition Function&lt;/span&gt;&lt;br /&gt;The partition function is created for setting the range partitions. The ranges can be set for a lower or upper threshold. The syntax is as follows&lt;br /&gt;CREATE PARTITION FUNCTION Function Name (Data Type)&lt;br /&gt;AS&lt;br /&gt;RANGE LEFT/RIGHT FOR VALUES (value1,value2,…)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;3) Creation of Partition Scheme&lt;/span&gt;&lt;br /&gt;The next step is to create the partition scheme after the partition function is created. This is needed for associating the partitions to a specific&lt;br /&gt;filegroups.&lt;br /&gt;&lt;br /&gt;The syntax is as follows&lt;br /&gt;CREATE PARTITION SCHEME Partition Scheme Name&lt;br /&gt;AS&lt;br /&gt;PARTITION Partition Function Name&lt;br /&gt;TO (Filegroup1,Filegroup2,….)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;4) Creation of Partition Table&lt;br /&gt;&lt;/span&gt;The next step is to create the partitioned table which would be associated with the defined partition scheme.&lt;br /&gt;&lt;br /&gt;The syntax is as follows&lt;br /&gt;CREATE TABLE Table Name&lt;br /&gt;(&lt;br /&gt;Column Name1 Datatype,&lt;br /&gt;Column Name2 Datatype,&lt;br /&gt;……..&lt;br /&gt;)&lt;br /&gt;ON Partition Scheme Name ( Column Name)&lt;br /&gt;&lt;br /&gt;The above four steps clearly states how to create a partitioned table.&lt;br /&gt;Querying a Partitioned Table&lt;br /&gt;After the creation of a partitioned table, now let us see how to query the data from the partitioned tables.&lt;br /&gt;Let us see the various cases in querying&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;a) Querying the data from a particular partition&lt;/span&gt;&lt;br /&gt;Syntax&lt;br /&gt;SELECT Column Name1…/* FROM Table Name WHERE $PARTITION.Partition Function Name(Column Name) =&lt;br /&gt;Partition Number&lt;br /&gt;&lt;br /&gt;The Partition number refers to first partition range or second partition range and so on, The first partition range is referred as 1 , second as 2&lt;br /&gt;and so on.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;b) Querying for Knowing the Partition Number&lt;/span&gt;&lt;br /&gt;Syntax&lt;br /&gt;SELECT $PARTITION.Partition Function Name(Column Name) = Partition Range Value&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;c) Querying to find the count of records in each partition&lt;/span&gt;&lt;br /&gt;Syntax&lt;br /&gt;SELECT $PARTITION.Partition Function Name(Column Name), COUNT(*) FROM Table Name GROUP BY $PARTITION.&lt;br /&gt;Partition Function Name(Column Name)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;SPLITTING OF PARTITION&lt;/span&gt;&lt;br /&gt;The partitions can be split by splitting the partition ranges. The splitting is done by using the alter partition command. We have to note that&lt;br /&gt;before we split the partition there should be a additional filegroup already associated in the partition scheme. If there is no unused filegroup&lt;br /&gt;available then we cannot split. So before splitting we have to ensure that a filegroup is added to the partition scheme. This is as shown below.&lt;br /&gt;&lt;br /&gt;SYNTAX&lt;br /&gt;ALTER PARTITION FUNCTION Partition Function Name () SPLIT RANGE (PARITITION RANGE VALUE)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;MERGING OF PARTITION&lt;/span&gt;&lt;br /&gt;The partitions can be merged by merging the partition ranges. The partition range value mentioned will merge that to the next greater&lt;br /&gt;partition range value into a singe partition. This is as shown below.&lt;br /&gt;&lt;br /&gt;SYNTAX&lt;br /&gt;ALTER PARTITION FUNCTION Partition Function Name () MERGE RANGE (PARITITION RANGE VALUE)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;ALTERING PARTITION SCHEME&lt;/span&gt;&lt;br /&gt;The partition scheme is altered to add new filegroup which may be required when partitions are splitted.&lt;br /&gt;&lt;br /&gt;SYNTAX&lt;br /&gt;ALTER PARTITION SCHEME Partition Scheme Name NEXT USED Filegroup Name&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;DROPPING OF PARTITION&lt;/span&gt;&lt;br /&gt;Let us see now how to drop partitions .&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;a) Drop a Partition Function&lt;/span&gt;&lt;br /&gt;To drop a partition function it should not have any partition scheme associated with it.&lt;br /&gt;&lt;br /&gt;Syntax&lt;br /&gt;DROP PARTITION FUNCTION Partition Function Name&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;b) Drop a Partition Scheme&lt;/span&gt;&lt;br /&gt;To drop a partition scheme it should not have any table associated with it.&lt;br /&gt;&lt;br /&gt;Syntax&lt;br /&gt;DROP PARTITION SCHEME Partition Scheme Name&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Partition Function Information&lt;/span&gt;&lt;br /&gt;The Partition Function Information is obtained from the sys.partition_functions table as shown below&lt;br /&gt;SELECT * FROM SYS.PARTITION_FUNCTIONS&lt;br /&gt;Partition Range Information&lt;br /&gt;The Partition Range information is obtained from the sys.partition_range_values as shown below&lt;br /&gt;SELECT * FROM SYS.PARTITION_RANGE_VALUES&lt;br /&gt;Partition Scheme Information&lt;br /&gt;The Partition Scheme information is obtained from the sys.partition_scheme as shown below&lt;br /&gt;SELECT * FROM SYS.PARTITION_SCHEME&lt;br /&gt;Partitions Information&lt;br /&gt;The Partition information can be obtained from the sys.partitions table as shown below.&lt;br /&gt;SELECT * FROM SYS.PARTITIONS&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Click here to download an example&lt;/span&gt; : &lt;/span&gt;&lt;a href="http://www.mshehadeh.com/sql/partition.txt"&gt;&lt;span style="color:#333399;"&gt;partition.sql&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-115744135417031682?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/115744135417031682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=115744135417031682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/115744135417031682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/115744135417031682'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2006/09/how-to-create-and-use-partition-in-sql_05.html' title='How to create and use partition in SQL SERVER 2005:'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-115259654041964304</id><published>2006-07-10T22:34:00.000-07:00</published><updated>2006-07-10T22:47:50.390-07:00</updated><title type='text'>SQL Server 2005 TableDiff utility</title><content type='html'>&lt;span style="color:#333399;"&gt;While testing the Replication in SQL 2005, I found one of the command line utilities that came with SQL Server 2005 named TableDiff. It's is primarily designed for comparing replicated tables, but we can take advantage of its functionality to compare tables in the same database or in different databases. The objective of this article is to demonstrate how we can take advantage of its functionality to compare tables.&lt;br /&gt;Let us assume that we have a table named TEST1 in the database TESTDB1,and a table named TEST2 in the database TESTDB2,the both tables TEST1 and TEST2 having the same structure,we will use the tablediff utility to generate script that will make the data in TEST2 exactly the same as TEST1,we can do the reverse by switching the source and the destination options parameter of Tablediff utility &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;N.B: The unique key is important for the data comparison&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;set quoted_identifier off&lt;br /&gt;go&lt;br /&gt;USE [master]&lt;br /&gt;GO&lt;br /&gt;IF EXISTS (SELECT name FROM sys.databases&lt;br /&gt;WHERE name = N'TESTDB1')&lt;br /&gt;DROP DATABASE [TESTDB1]&lt;br /&gt;go&lt;br /&gt;create database TESTDB1&lt;br /&gt;go&lt;br /&gt;use TESTDB1&lt;br /&gt;go&lt;br /&gt;create table TEST1 (id int primary key,&lt;br /&gt;name varchar(100),&lt;br /&gt;sal money)&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;ALTER TABLE TEST1 ADD UNIQUE&lt;br /&gt;( [ID] ASC )&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;insert into TEST1 select 1,"Name1",1000&lt;br /&gt;insert into TEST1 select 2,"Name2",2000&lt;br /&gt;insert into TEST1 select 3,"Name3",3000&lt;br /&gt;insert into TEST1 select 4,"Name4",4000&lt;br /&gt;go&lt;br /&gt;USE [master]&lt;br /&gt;GO&lt;br /&gt;IF EXISTS (SELECT name FROM sys.databases&lt;br /&gt;WHERE name = N'TESTDB2')&lt;br /&gt;DROP DATABASE [TESTDB2]&lt;br /&gt;go&lt;br /&gt;Create database TESTDB2&lt;br /&gt;go&lt;br /&gt;use TESTDB2&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;create table TEST2 (id int primary key,&lt;br /&gt;name varchar(100),&lt;br /&gt;sal money)&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;ALTER TABLE TEST2 ADD UNIQUE&lt;br /&gt;( [ID] ASC )&lt;br /&gt;go&lt;br /&gt;&lt;br /&gt;insert into TEST2 select 1,"Name1",1000&lt;br /&gt;insert into TEST2 select 2,"Name2",2000&lt;br /&gt;insert into TEST2 select 4,"Name4",5000&lt;br /&gt;insert into TEST2 select 9,"Name9",9000&lt;br /&gt;go &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;From to the command line type the following commands:&lt;br /&gt;Type cd Type cd C:\Program Files\Microsoft SQL Server\90\COM&lt;br /&gt;Than when the command prompt changed to&lt;br /&gt;C:\Program Files\Microsoft SQL Server\90\COM&gt;&lt;br /&gt;type &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;em&gt;tablediff -sourceserver "ABOUHMEID02\SQLEXPRESS" -sourcedatabase "TESTDB1" -sourcetable "TEST1" -sourceuser "sa" -sourcepassword "sa" -destinationserver "ABOUHMEID02\SQLEXPRESS" -destinationdatabase "TESTDB2" -destinationtable "TEST2" -destinationuser "sa" -destinationpassword "sa" -f "c:\compare.sql"&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;N.B: If you installed SQL SERVER 2005 in a directory different than&lt;br /&gt;C:\ Program Files\Microsoft SQL Server\90\COM folder&lt;br /&gt;Change the path depending on your installation configuration.&lt;br /&gt;The TableDiff utility is installed by default under&lt;br /&gt;C:\Program Files\Microsoft SQL Server\90\COM folder&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Result&lt;br /&gt;User-specified agent parameter values:&lt;br /&gt;-sourceserver ABOUHMEID02\SQLEXPRESS&lt;br /&gt;-sourcedatabase TESTDB1&lt;br /&gt;-sourcetable TEST1&lt;br /&gt;-sourceuser sa&lt;br /&gt;-sourcepassword sa&lt;br /&gt;-destinationserver ABOUHMEID02\SQLEXPRESS&lt;br /&gt;-destinationdatabase TESTDB2&lt;br /&gt;-destinationtable TEST2&lt;br /&gt;-destinationuser sa&lt;br /&gt;-destinationpassword sa&lt;br /&gt;-f c:\compare.sql&lt;br /&gt;&lt;br /&gt;Table [TESTDB1].[dbo].[TEST1] on ABOUHMEID02\SQLEXPRESS and Table [TESTDB2].[dbo].[TEST2] on ABOUHMEID02\SQLEXPRESS have 3 differences.&lt;br /&gt;Fix SQL written to c:\compare.sql.&lt;br /&gt;Err id Col&lt;br /&gt;Src. Only 3&lt;br /&gt;Mismatch 4 sal&lt;br /&gt;Dest. Only 9&lt;br /&gt;The requested operation took 0.40625 seconds. &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#333399;"&gt;The generated sql file C:\Compare.SQL file : &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#333399;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;em&gt;-- Host: ABOUHMEID02\SQLEXPRESS&lt;br /&gt;-- Database: [TESTDB2]&lt;br /&gt;-- Table: [dbo].[TEST2]&lt;br /&gt;INSERT INTO [dbo].[TEST2] ([id],[name],[sal]) VALUES (3,'Name3',3000.0000)&lt;br /&gt;UPDATE [dbo].[TEST2] SET [sal]=4000.0000 WHERE [id] = 4&lt;br /&gt;DELETE FROM [dbo].[TEST2] WHERE [id] = 9 &lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-115259654041964304?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/115259654041964304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=115259654041964304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/115259654041964304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/115259654041964304'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2006/07/sql-server-2005-tablediff-utility.html' title='SQL Server 2005 TableDiff utility'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-115017879952132918</id><published>2006-06-12T22:49:00.000-07:00</published><updated>2006-06-12T23:06:39.523-07:00</updated><title type='text'>Importing a SDO file manually using VB script in MCMS 2002</title><content type='html'>&lt;p&gt;&lt;span style="color:#333399;"&gt;When i tried to import a large SDO file (18 MB), from Site manager on a machine with Windows 2003 server,MCMS 2002 with Sp1a installed i got the following error:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;Error: 0Description: The underlying connection was closed: An unexpected error occurred on a receive. Severity: 5Source: System Debug info: N/A Extra info: N/A Client Source: CImProgress::ProcessPackage Recommended Action: N/A&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#333399;"&gt;So i tried to import the SDO file using VB script instead of doing it from site manager and it works, below you will find a file named import.vbs&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;' VBScript for performing an import operation.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;'usage: import.vbs filename.sdo&lt;br /&gt;Dim strROPPath&lt;br /&gt;Dim shell&lt;br /&gt;Dim fso&lt;br /&gt;strROPPath = WScript.Arguments(0)&lt;br /&gt;Set fso = WScript.CreateObject("Scripting.FileSystemObject")&lt;br /&gt;If ( fso.FileExists(strROPPath) ) Then&lt;br /&gt;Call Import(strROPPath)&lt;br /&gt;Else&lt;br /&gt;Call MsgBox(strROPPath, vbCritical, "File Does Not Exist")&lt;br /&gt;End If&lt;br /&gt;'**************************************&lt;br /&gt;'* Routine that does the import.&lt;br /&gt;'**************************************&lt;br /&gt;Sub Import(strROPPath)&lt;br /&gt;Dim pCmsDeployImport&lt;br /&gt;On Error Resume Next&lt;br /&gt;Set pCmsDeployImport = WScript.CreateObject("CmsDeployServer.CmsDeployImport.1")&lt;br /&gt;If ( Err.Number &lt;&gt; 0 ) Then&lt;br /&gt;Call MsgBox(Err.Description, vbCritical, "Import Problem")&lt;br /&gt;Set pCmsDeployImport = Nothing&lt;br /&gt;Exit Sub&lt;br /&gt;End If&lt;br /&gt;pCmsDeployImport.AuthenticateAsCurrentUser()&lt;br /&gt;If ( Err.Number &lt;&gt; 0 ) Then&lt;br /&gt;Call MsgBox(Err.Description, vbCritical, "Import Problem")&lt;br /&gt;Set pCmsDeployImport = Nothing&lt;br /&gt;Exit Sub&lt;br /&gt;End If&lt;br /&gt;Dim pImportOptions&lt;br /&gt;Set pImportOptions = pCmsDeployImport.Options&lt;br /&gt;If ( Err.Number &lt;&gt; 0 ) Then&lt;br /&gt;Call MsgBox(Err.Description, vbCritical, "Import Problem")&lt;br /&gt;Set pCmsDeployImport = Nothing&lt;br /&gt;Set pImportOptions = Nothing&lt;br /&gt;Exit Sub&lt;br /&gt;End If&lt;br /&gt;' Importing the grant rights&lt;br /&gt;pImportOptions.IncludeRightsGroups = 3&lt;br /&gt;pImportOptions.RightsOnAdd = 3&lt;br /&gt;pImportOptions.RightsOnReplace = 2&lt;br /&gt;pImportOptions.IncludeCreatedBy = 2&lt;br /&gt;Dim strReportUrl&lt;br /&gt;strReportUrl = pCmsDeployImport.Import(strROPPath)&lt;br /&gt;If ( Err.Number &lt;&gt; 0 ) Then&lt;br /&gt;Call MsgBox(Err.Description, vbCritical, "Import Problem")&lt;br /&gt;Set pCmsDeployImport = Nothing&lt;br /&gt;Set pImportOptions = Nothing&lt;br /&gt;Exit Sub&lt;br /&gt;End If&lt;br /&gt;' Display the report in the Web browser.&lt;br /&gt;Set shell = WScript.CreateObject("WScript.Shell")&lt;br /&gt;shell.Run "http://localhost" &amp;amp; strReportUrl, 7&lt;br /&gt;Call MsgBox( strReportUrl,vbInformation,"" )&lt;br /&gt;Set shell = Nothing&lt;br /&gt;Set pCmsDeployImport = Nothing&lt;br /&gt;Set pImportOptions = Nothing&lt;br /&gt;End Sub&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-115017879952132918?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/115017879952132918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=115017879952132918' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/115017879952132918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/115017879952132918'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2006/06/importing-sdo-file-manually-using-vb_12.html' title='Importing a SDO file manually using VB script in MCMS 2002'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-114862328904511896</id><published>2006-05-25T22:43:00.000-07:00</published><updated>2006-05-30T09:10:24.200-07:00</updated><title type='text'>Killing all processes in the database 'DBNAME' except those connected throw OSQL in Sql Server</title><content type='html'>&lt;strong&gt;&lt;span style="color:#333399;"&gt;I have to restore a snapshot of a Sql server database daily used in a web site,to do this i must be in exclusive mode and the only user connected to the database, so i came up with this script to kill all processes connected to 'DBNAME' , except connected throw OSQL (my connection):&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#333399;"&gt;First of all let's create a procedure to kill db processes:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;use master&lt;/em&gt;&lt;br /&gt;&lt;em&gt;go&lt;br /&gt;CREATE proc kill_process(&lt;/em&gt;&lt;br /&gt;&lt;em&gt;@dname varchar(20))&lt;/em&gt;&lt;br /&gt;&lt;em&gt;as&lt;br /&gt;Declare &lt;/em&gt;&lt;br /&gt;&lt;em&gt;@did int, &lt;/em&gt;&lt;br /&gt;&lt;em&gt;@sid int, &lt;/em&gt;&lt;br /&gt;&lt;em&gt;@s nvarchar(128)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;select @did = dbid &lt;/em&gt;&lt;br /&gt;&lt;em&gt;from master..sysdatabases &lt;/em&gt;&lt;br /&gt;&lt;em&gt;where name = @dname&lt;/em&gt;&lt;br /&gt;&lt;em&gt;declare spid_cursor cursor for &lt;/em&gt;&lt;br /&gt;&lt;em&gt;select spid &lt;/em&gt;&lt;br /&gt;&lt;em&gt;from master..sysprocesses &lt;/em&gt;&lt;br /&gt;&lt;em&gt;where dbid = @did &lt;/em&gt;&lt;br /&gt;&lt;em&gt;and program_name &lt;&gt; 'OSQL-32'&lt;/em&gt;&lt;br /&gt;&lt;em&gt;open spid_cursorfetch next &lt;/em&gt;&lt;br /&gt;&lt;em&gt;from spid_cursor &lt;/em&gt;&lt;br /&gt;&lt;em&gt;into @s&lt;/em&gt;&lt;br /&gt;&lt;em&gt;While @@fetch_status = 0 &lt;/em&gt;&lt;br /&gt;&lt;em&gt;Begin &lt;/em&gt;&lt;br /&gt;&lt;em&gt;Select @s = 'Kill '+convert(nvarchar(30),@sid) &lt;/em&gt;&lt;br /&gt;&lt;em&gt;exec(@s) &lt;/em&gt;&lt;br /&gt;&lt;em&gt;--print @s &lt;/em&gt;&lt;br /&gt;&lt;em&gt;fetch next &lt;/em&gt;&lt;br /&gt;&lt;em&gt;from spidcurs &lt;/em&gt;&lt;br /&gt;&lt;em&gt;into @sid&lt;/em&gt;&lt;br /&gt;&lt;em&gt;End&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Deallocate spidcurs&lt;/em&gt;&lt;br /&gt;&lt;em&gt;GO&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#333399;"&gt;Now how to use this procedure:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;USE MASTER &lt;/em&gt;&lt;br /&gt;&lt;em&gt;go&lt;br /&gt;--Killing all processes in the database 'DBNAME' except those connected throw OSQL&lt;/em&gt;&lt;br /&gt;&lt;em&gt;exec proc kill_process 'DBNAME'&lt;/em&gt;&lt;br /&gt;&lt;em&gt;go&lt;br /&gt;---set the database to single user mode&lt;/em&gt;&lt;br /&gt;&lt;em&gt;sp_dboption 'DBNAME', 'single user', true&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color:#333399;"&gt;now let's do the database restore,and don't forget to remove single user mode while finishing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;sp_dboption 'DBNAME', 'single user', false&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-114862328904511896?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/114862328904511896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=114862328904511896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/114862328904511896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/114862328904511896'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2006/05/killing-all-processes-in-database.html' title='Killing all processes in the database &apos;DBNAME&apos; except those connected throw OSQL in Sql Server'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14236385.post-114846548464581546</id><published>2006-05-24T03:10:00.000-07:00</published><updated>2006-05-24T04:14:32.343-07:00</updated><title type='text'>Microsoft SQL Server Migration Assistant for Oracle (SSMA)</title><content type='html'>&lt;span style="color:#333399;"&gt;I was working on converting an oracle database to SQL Server 2005 using SSMA ,so i remarked that if you have an oracle package and because there is no package in SQL Server,so using SSMA the package conversion is done using the following convention :Package functions will be converted to user-defined functions using PackageName_FunctionName naming convention.Package procedures will be converted to stored procedures using PackageName_ProcedureName naming convention.Package variables are emulated using a table and a set of functions.So you must change the function call in your application from PackageName.FunctionName to PackageName_FunctionName, and the procedure call from PackageName.ProcedureName to PackageName_ProcedureName.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14236385-114846548464581546?l=mshehadeh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshehadeh.blogspot.com/feeds/114846548464581546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14236385&amp;postID=114846548464581546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/114846548464581546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14236385/posts/default/114846548464581546'/><link rel='alternate' type='text/html' href='http://mshehadeh.blogspot.com/2006/05/microsoft-sql-server-migra_114846548464581546.html' title='Microsoft SQL Server Migration Assistant for Oracle (SSMA)'/><author><name>Mohamad Shehadeh</name><uri>http://www.blogger.com/profile/01344180504438261686</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://www.mshehadeh.com/personal/20061002.jpg'/></author><thr:total>0</thr:total></entry></feed>
