<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fun stuff with SQL Server Archives - Dragonsoft Technology View</title>
	<atom:link href="https://blog.dragonsoft.us/category/technology/fun-stuff-with-sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.dragonsoft.us/category/technology/fun-stuff-with-sql-server/</link>
	<description>Talk about Technologies, Software Architecture and Management</description>
	<lastBuildDate>Sun, 08 May 2022 00:10:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://blog.dragonsoft.us/wp-content/uploads/2022/04/logo-main-bw-150x150.png</url>
	<title>Fun stuff with SQL Server Archives - Dragonsoft Technology View</title>
	<link>https://blog.dragonsoft.us/category/technology/fun-stuff-with-sql-server/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">2577970</site>	<item>
		<title>Implementing Custom Security Extensions for SQL Server 2008 R2</title>
		<link>https://blog.dragonsoft.us/2011/10/14/installing-custom-security-extensions-for-ssrs/</link>
					<comments>https://blog.dragonsoft.us/2011/10/14/installing-custom-security-extensions-for-ssrs/#comments</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sat, 15 Oct 2011 00:21:23 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[2008 R2]]></category>
		<category><![CDATA[custom forms authentication]]></category>
		<category><![CDATA[Custom Security Extension]]></category>
		<category><![CDATA[Error 503]]></category>
		<category><![CDATA[form authentication]]></category>
		<category><![CDATA[HTTP Error 503]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[Security Extension]]></category>
		<category><![CDATA[Service Unavailable]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<category><![CDATA[SSRS 2008 R2]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=1332</guid>

					<description><![CDATA[<p>Introduction This article has been contributed by Daniel Klionsky and based on the work we have done within our team allowing single sign-on integration of SQL Server Reporting Services within existing application. I want to mention and praise great help provided by Carlos Sereno who was able to clarify many<a class="moretag" href="https://blog.dragonsoft.us/2011/10/14/installing-custom-security-extensions-for-ssrs/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2011/10/14/installing-custom-security-extensions-for-ssrs/">Implementing Custom Security Extensions for SQL Server 2008 R2</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><strong>Introduction</strong></h2>
<p>This article has been contributed by Daniel Klionsky and based on the work we have done within our team allowing single sign-on integration of SQL Server Reporting Services within existing application.</p>
<p>I want to mention and praise great help provided by Carlos Sereno who was able to clarify many questions for us.</p>
<p>Please enjoy the reading and let us know if it did indeed work for you as well.</p>
<h2><strong>SSRS</strong></h2>
<p>SQL Server Reporting Services provides a full range of ready-to-use tools and services to help you create, deploy, and manage reports for your organization, as well as programming features that enable you to extend and customize your reporting functionality.</p>
<p>Reporting Services is a server-based reporting platform that provides comprehensive reporting functionality for a variety of data sources. Reporting Services includes a complete set of tools for you to create, manage, and deliver reports, and APIs that enable developers to integrate or extend data and report processing in custom applications.</p>
<p>Reporting Services tools work within the Microsoft Visual Studio environment and are fully integrated with SQL Server tools and components.</p>
<p><span id="more-1332"></span></p>
<h2><strong>SSRS Security Models</strong></h2>
<p>To effectively secure a Reporting Services installation, you must evaluate your security needs from end-to-end, taking into account the environment in which the server is deployed, the types of reports you are hosting, user access requirements, and distribution.</p>
<p>Reporting Services provides an authentication subsystem and a role-based authorization model that determines access to the report server and to items that are managed by the report server. Authentication is based on Windows Authentication or a custom authentication module that you provide. Authorization is based on roles that you assign to users or groups in your organization.</p>
<p>Reporting Services handles all authentication functions for HTTP requests through either the Windows Authentication extension that is installed with the server or a custom authentication extension that you deploy.</p>
<p>By default, Reporting Services uses a Windows-based security extension to authenticate the identities of users on the system. You have to replace the default security to accommodate custom security in your enterprise.</p>
<p>In addition, there is no native support for single sign-on technologies (SSO) in Reporting Services. If you want to use a single sign-on technology, you must create a custom authentication extension.</p>
<h2><strong>Custom Security Extension</strong></h2>
<p>Reporting Services provides architecture that allows you to plug in custom or forms-based authentication modules. You might consider implementing a custom authentication extension if deployment requirements do not include Windows integrated security.</p>
<p>The most common scenario for using custom authentication is to support Internet or extranet access to a Web application. Replacing the default Windows Authentication extension with a custom authentication extension gives you more control over how external users are granted access to the report server.</p>
<p>In practice, deploying a custom authentication extension requires multiple steps that include copying assemblies and application files, modifying configuration files, and testing.</p>
<p>Per Microsoft, creating a custom authentication extension requires custom code and expertise in ASP.NET security. For more information about custom authentication architecture, see <a href="http://msdn.microsoft.com/en-us/library/ms155029.aspx" target="_blank">Implementing a Security Extension</a>.</p>
<h2><strong>Custom Security Extension on SSRS 2008 R2</strong></h2>
<p>For this article, the system configuration consisted of SQL Server 2008 R2 (SP1) &#8211; 10.50.2500.0 (X64) Developer Edition installed on Windows 7.</p>
<p>A sample of Custom Security Extension, is readily available on codeplex.com [2] .</p>
<p>Unfortunately, the above code sample seems to work for the versions up to 2008 and not for sql 2008 r2. Several install attempts ended up with the same error:</p>
<blockquote><p>‘Service Unavailable’ &#8211; HTTP Error 503. The service is unavailable.</p></blockquote>
<p>Posting the message in the <a href="http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/threads/" target="_blank">SQL Server Reporting Services Forum</a>, Thread Title <a href="http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/5a8af9f4-7ae1-4513-9a84-d727e2150596/" target="_blank">`Service Unavailable` Error while installing Custom Security Ext on sql 2008 r2</a> did not help to resolve the issue, as moderator informed that there were no official sample for sql 2008 R2. It was very discouraging since sql 2008 r2 contains some very handy features such as Report Writer 3.0 and going back to SQL Server 2008 was very undesirable.</p>
<p>While checking out for other reporting solutions on the market, Carlos Sereno posted a message forum indicating that, after all, it was possible to have Custom Security Extension on ssrs 2008 R2 and Carlos has already done that. So after plugging in his tips and after several attempts, it finally started to work.</p>
<h2><strong>Steps</strong></h2>
<ol>
<li>Compiling the sample project in Visual Studio 2010
<ul>
<li>The codeplex example is using ReportService2005 endpoint. In 2008 R2, however, the Report Server Web service provides a new ReportService2010 endpoint which includes functionality of the ReportService2005 endpoint. You will need to use ReportService2010 endpoint in your .net project. You can add a reference to 2010.asmx either by adding ReportingServices2010.cs, a proxy class provided here [5] or by adding a webService reference to <strong>http:///reportserver/reportexecution2005.asmx?wsdl</strong> (though a resulting file will be larger). Instructions can be found at [6]</li>
<li>You will need to remove ReportingServices2005.cs that is included with Custom Security Extension project by default.<br />
With the use of ReportService2010.asmx, in your .net project, AuthenticationUtilities.cs module don’t forget to replace</p>
<pre class="brush: csharp; title: ; notranslate">private const string rsAsmx = @&quot;/ReportService2005.asmx&quot;;
 with
 private const string rsAsmx = @&quot;/ReportService2010.asmx&quot;;
</pre>
</li>
</ul>
</li>
<li>After the sample is compiled, copy the DLLs and the ASPX pages to the appropriate subdirectories for your Report Server installation.
<ul>
<li>Copy Microsoft.Samples.ReportingServices.CustomSecurity.dll and Microsoft.Samples.ReportingServices.CustomSecurity.pdb to the \ReportServer\bin directory.</li>
<li>Copy Microsoft.Samples.ReportingServices.CustomSecurity.dll and Microsoft.Samples.ReportingServices.CustomSecurity.pdb to the \ReportManager\bin directory.</li>
<li>Copy the Logon.aspx page to the \ReportServer directory.</li>
<li>Copy the UILogon.aspx page to the \ReportManager\Pages directory.</li>
</ul>
</li>
</ol>
<h2>Modify the RSReportServer.config file</h2>
<ol>
<li>Open the RSReportServer.config file with Visual Studio 2010 or a simple text editor such as Notepad. RSReportServer.config is located in the \ReportServer directory.</li>
<li>Locate the &lt;<strong>AuthenticationTypes</strong>&gt; element and modify the settings as follows:
<pre class="brush: xml; title: ; notranslate">&lt;Authentication&gt;
  &lt;AuthenticationTypes&gt;&lt;Custom/&gt;&lt;/AuthenticationTypes&gt;
  &lt;EnableAuthPersistence&gt;true&lt;/EnableAuthPersistence&gt;
  &lt;RSWindowsExtendedProtectionLevel&gt;Off&lt;/RSWindowsExtendedProtectionLevel&gt;
  &lt;RSWindowsExtendedProtectionScenario&gt;Proxy&lt;/RSWindowsExtendedProtectionScenario&gt;
&lt;/Authentication&gt;</pre>
</li>
</ol>
<p>Both RSWindowsExtendedProtectionLevel and RSWindowsExtendedProtectionScenario are required entries for SSRS 2008 R2 [3].</p>
<ol>
<li>Locate the <strong>&lt;Security&gt;</strong> and <strong>&lt;Authentication&gt;</strong> elements, within the <strong>&lt;Extensions&gt;</strong>, and modify the settings as follows:
<pre class="brush: xml; title: ; notranslate">&lt;Security&gt;
  &lt;Extension Name=&quot;Forms&quot;
Type=&quot;Microsoft.Samples.ReportingServices.CustomSecurity.Authorization,
Microsoft.Samples.ReportingServices.CustomSecurity&quot; &gt;
&lt;Configuration&gt;
&lt;AdminConfiguration&gt;
&lt;UserName&gt;username&lt;/UserName&gt;
      &lt;/AdminConfiguration&gt;
    &lt;/Configuration&gt;
  &lt;/Extension&gt;
&lt;/Security&gt;
&lt;Authentication&gt;
  &lt;Extension Name=&quot;Forms&quot;
Type=&quot;Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension,
Microsoft.Samples.ReportingServices.CustomSecurity&quot; /&gt;
&lt;/Authentication&gt;
</pre>
</li>
<li>Locate the <strong>&lt;UI&gt;</strong> element and update it as follows:
<pre class="brush: xml; title: ; notranslate">&lt;UI&gt;
&lt;CustomAuthenticationUI&gt;
&lt;loginUrl&gt;/Pages/UILogon.aspx&lt;/loginUrl&gt;
&lt;UseSSL&gt;True&lt;/UseSSL&gt;
&lt;/CustomAuthenticationUI&gt;
&lt;ReportServerUrl&gt;http://&lt;server&gt;/ReportServer&lt;/ReportServerUrl&gt;
&lt;/UI&gt;
</pre>
</li>
</ol>
<h2>Modify the RSSrvPolicy.config file</h2>
<ol>
<li>Open the RSSrvPolicy.config file located in the \ReportServer directory.</li>
<li>Add the following element after the existing code group in the security policy file that has a URL membership of $CodeGen as indicated below and then add an entry as follows to RSSrvPolicy.config:
<pre class="brush: xml; title: ; notranslate">&lt;CodeGroup class=&quot;UnionCodeGroup&quot; version=&quot;1&quot; Name=&quot;SecurityExtensionCodeGroup&quot; Description=&quot;Code group for the sample security extension&quot; PermissionSetName=&quot;FullTrust&quot;&gt;
&lt;IMembershipCondition class=&quot;UrlMembershipCondition&quot; version=&quot;1&quot; Url=&quot;C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll&quot;
/&gt;
&lt;/CodeGroup&gt;
</pre>
</li>
</ol>
<h2>Modify the Web.config file for Report Server</h2>
<ol>
<li>Open the Web.config file in a text editor. By default, the file is located in the &lt;install&gt;\ReportServer directory.</li>
<li>Locate the <strong>&lt;identity&gt;</strong> element and set the <strong>Impersonate</strong> attribute to <strong>false</strong>.
<pre class="brush: xml; title: ; notranslate">&lt;identity impersonate=&quot;false&quot; /&gt;</pre>
</li>
<li>Locate the <strong>&lt;authentication&gt;</strong> element and change the <strong>Mode</strong> attribute to <strong>Forms</strong>.</li>
<li>Add the following <strong>&lt;forms&gt;</strong> element as a child of the <strong>&lt;authentication&gt;</strong> element and set the <strong>loginUrl</strong>, <strong>name</strong>, <strong>timeout</strong>, and <strong>path</strong> attributes as follows:
<pre class="brush: xml; title: ; notranslate">&lt;authentication mode=&quot;Forms&quot;&gt;
&lt;forms loginUrl=&quot;logon.aspx&quot; name=&quot;sqlAuthCookie&quot; timeout=&quot;60&quot; path=&quot;/&quot;&gt;&lt;/forms&gt;
&lt;/authentication&gt;
</pre>
</li>
<li>Add the following <strong>&lt;authorization&gt;</strong> element directly after the <strong>&lt;authentication&gt;</strong> element.
<pre class="brush: xml; title: ; notranslate">&lt;authorization&gt;
&lt;deny users=&quot;?&quot; /&gt;
&lt;/authorization&gt;</pre>
<p><strong>This will deny unauthenticated users the right to access the report server.<br />
</strong> The previously established <strong>loginUrl</strong> attribute of the <strong>&lt;authentication&gt;</strong> element will redirect unauthenticated requests to the Logon.aspx page.</li>
</ol>
<h2>Modify the Web.config file for Report Manager</h2>
<ol>
<li>Open the Web.config for Report Manager. It is located in the &lt;install&gt;\ReportManager directory.</li>
<li>Disable impersonation by locating the section <strong>&lt;identity impersonate= &#8220;true&#8221; /&gt;</strong> and changing it to the following <strong>&lt;identity impersonate=&#8221;false&#8221; /&gt;</strong></li>
<li>Add the following keys to the <strong>&lt;appSettings&gt;</strong> element.
<pre class="brush: xml; title: ; notranslate">&lt;add key=&quot;ReportServer&quot; value=&quot;&lt;Server Name&gt;&quot;/&gt;
&lt;add key=&quot;ReportServerInstance&quot; value=&quot;&lt;Instance Name&gt;&quot;/&gt;
</pre>
<p>Change the <strong>&lt;Server Name&gt; </strong>value to the name of the report server and the <strong>&lt;Instance Name&gt;</strong> value to the name of the instance the report server is associated with.</li>
</ol>
<h2>Creating the UserAccounts Database</h2>
<p>The sample includes a database script, Createuserstore.sql, that enables you to set up a user store for the Forms sample in a SQL Server database.</p>
<h3>To test the sample</h3>
<ol>
<li>Restart the Reporting Services service by running the following commands at the command prompt:
<pre class="brush: plain; title: ; notranslate">net stop &quot;SQL Server Reporting Services ()&quot;
 net start &quot;SQL Server Reporting Services ()&quot;
</pre>
</li>
<li>Open Report Manager. You can do this from the Reporting Services program menu or by accessing the Reports virtual directory from your browser.</li>
<li>Enter a user name and password and click <strong>Register User</strong> to add the user to the accounts database.</li>
<li>Open the RSReportServer.config file. Locate the <strong>&lt;Security&gt;</strong> element and add the previously registered user name as follows:
<pre class="brush: xml; title: ; notranslate">
&lt;Security&gt;
&lt;Extension Name=&quot;Forms&quot; Type=&quot;Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity&quot; &gt;
&lt;Configuration&gt;
&lt;AdminConfiguration&gt;
&lt;UserName&gt;username&lt;/UserName&gt;
&lt;/AdminConfiguration&gt;
&lt;/Configuration&gt;
&lt;/Extension&gt;
&lt;/Security&gt;
</pre>
</li>
<li>Return to the UILogon.aspx page, re-enter the user name and password, and then click <strong>Logon</strong>. You should have access to Report Manager and the report server with no restrictions. The administrator user that you create has equivalent permissions on the report server to those of a built-in administrator account on the local computer. For the purpose of this sample, you can only have one user designated as an administrator. After you have a built-in administrator account, you can register additional users and assign them roles on the report server.</li>
</ol>
<h2>Links</h2>
<p>[2]. <a href="http://msftrsprodsamples.codeplex.com/wikipage?title=SS2008%21Security%20Extension%20Sample&amp;referringTitle=Home" target="_blank">Readme_Security Extension Sample</a><br />
[3]. <a href="http://support.microsoft.com/kb/2146062" target="_blank">Required configuration for Extended Protection in Reporting Services</a><br />
<a href="http://msdn.microsoft.com/en-us/library/ff487481.aspx" target="_blank">Extended Protection for Authentication with Reporting Services</a><br />
<a href="http://msdn.microsoft.com/en-us/library/cc281253.aspx" target="_blank">How to: Configure Windows Authentication in Reporting Services</a><br />
[4]. <a href="http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/5a8af9f4-7ae1-4513-9a84-d727e2150596/" target="_blank">Service Unavailable` Error while installing Custom Security Ext on sql 2008 r2</a><br />
[5]. <a href="http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/cef0738d-14bb-43d5-a82f-74b485e10a82" target="_blank">Create a Web Service Proxy for ReportingService 2010</a><br />
[6]. <a href="http://msdn.microsoft.com/en-us/library/ms155134.aspx" target="_blank">Creating the Web Service Proxy</a></p>
<h2>Further reading</h2>
<ul>
<li><a href="http://blogs.msdn.com/b/cliffgreen/archive/2011/03/29/reporting-services-single-sign-on-sso-authentication-part-1.aspx" target="_blank">Reporting Services Single Sign On (SSO) Authentication</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms152825.aspx" target="_blank">Security Extensions Overview</a></li>
</ul>
<p>Enjoy.</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span><p>The post <a href="https://blog.dragonsoft.us/2011/10/14/installing-custom-security-extensions-for-ssrs/">Implementing Custom Security Extensions for SQL Server 2008 R2</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2011/10/14/installing-custom-security-extensions-for-ssrs/feed/</wfw:commentRss>
			<slash:comments>26</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1332</post-id>	</item>
		<item>
		<title>SQL Server 2008 R2 : install mess</title>
		<link>https://blog.dragonsoft.us/2011/04/29/sql-server-2008-r2-install-mess/</link>
					<comments>https://blog.dragonsoft.us/2011/04/29/sql-server-2008-r2-install-mess/#respond</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Fri, 29 Apr 2011 23:47:20 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[install problem]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[registry permissions]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=1271</guid>

					<description><![CDATA[<p>Back in 2008 I wrote an article about &#8220;reboot check&#8221; error with installer. Now it is time to mention another situation &#8211; total failure of installing SQL Server 2008 R2 on the machine with prior installation of SQL Server 2008. Please note that if you work with Visual Studio 2010 you<a class="moretag" href="https://blog.dragonsoft.us/2011/04/29/sql-server-2008-r2-install-mess/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2011/04/29/sql-server-2008-r2-install-mess/">SQL Server 2008 R2 : install mess</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Back in 2008 I wrote an article about &#8220;<a href="/2008/11/08/tip-installing-sql-server-2008-reboot-required-check-fails/" target="_blank">reboot check</a>&#8221; error with installer.</p>
<p>Now it is time to mention another situation &#8211; total failure of installing SQL Server 2008 R2 on the machine with prior installation of SQL Server 2008. Please note that if you work with Visual Studio 2010 you would most likely get express edition unless declined during install. I do not know for sure if it is related but&#8230; just happened to be that after doing unrelated reinstall of VS 2010 I have to reinstall SQL Server 2008 R2 Dev build on the same machine as well.</p>
<p>Fan started when installer refused to be applied on top of existing installation, nice and very informative error about with 2 pages of debug data would appear&#8230;</p>
<blockquote><p>An error occurred creating the configuration section handler for &#8230;</p></blockquote>
<p>Per MSDN Blog, the following solution was suggested &#8211; <a href="http://blogs.msdn.com/b/vsnetsetup/archive/2009/10/29/sql-server-2008-setup-fails-with-a-microsoft-net-framework-exception.aspx" target="_blank">Delete Microsoft Folder in user&#8217;s Application Data Folder</a>.</p>
<blockquote><p><em><strong>PS: Do not forget to make a registry backup before the doing anything suggested below</strong></em></p></blockquote>
<p>OK, then we get to the next hurdle and this is actually more complex&#8230; During deployment of actual components error dialog pops up similar to this</p>
<p><img fetchpriority="high" decoding="async" src="http://blog.dragonsoft.us/wp-content/uploads/2011/04/image23.png" alt="" title="image23" width="616" height="177" class="alignnone size-full wp-image-1281" alt="The following error has occurred: Could not open key: UNKNOWN\Components\CBFF54E0ED12B0946A1C52E5E82ABC38\E7BEEF5F746F8AB9076051A5574.  Verify that you have sufficient access to that key, or contact your support personnel." srcset="https://blog.dragonsoft.us/wp-content/uploads/2011/04/image23.png 616w, https://blog.dragonsoft.us/wp-content/uploads/2011/04/image23-300x86.png 300w" sizes="(max-width: 616px) 100vw, 616px" /></p>
<p>After few attempts to fix it, I have stumbled on <a href="http://www.intellitechture.com/SQL-Server-2008-Install-Nightmare/" target="_blank">this nice article</a>. Brace yourself to a long read, attempts to solve errors one by one, or just scroll to the end and just restore registry to its default state for permissions with</p>
<p>If this still fails, consider resetting registry permissions back to the<br />
default settings using the following command:</p>
<pre class="brush: bash; title: ; notranslate">secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose /areas REGKEYS</pre>
<p>This nice little thing will solve all the mysteries&#8230;</p>
<p>Enjoy</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span><p>The post <a href="https://blog.dragonsoft.us/2011/04/29/sql-server-2008-r2-install-mess/">SQL Server 2008 R2 : install mess</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2011/04/29/sql-server-2008-r2-install-mess/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1271</post-id>	</item>
		<item>
		<title>SQL Server: Tables, Views and missing columns</title>
		<link>https://blog.dragonsoft.us/2010/02/26/tables-views-missing-columns/</link>
					<comments>https://blog.dragonsoft.us/2010/02/26/tables-views-missing-columns/#respond</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Fri, 26 Feb 2010 13:42:30 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[invalid column]]></category>
		<category><![CDATA[invalid data]]></category>
		<category><![CDATA[refresh metadata]]></category>
		<category><![CDATA[refresh object]]></category>
		<category><![CDATA[refresh view]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sp_refreshsqlmodule]]></category>
		<category><![CDATA[sp_refreshview]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[view schema]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=1109</guid>

					<description><![CDATA[<p>When it comes to non-schema-bound-views (NSB View)&#160;it is important to remember that there is no schema bound between objects used in the view and metadata for a view. Let&#8217;s look at the following scenario: -- Create Table_1 CREATE TABLE dbo.Table_1 (Col_A int NULL, Col_B numeric(18, 0) NULL, Col_C nvarchar(50) NULL)<a class="moretag" href="https://blog.dragonsoft.us/2010/02/26/tables-views-missing-columns/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2010/02/26/tables-views-missing-columns/">SQL Server: Tables, Views and missing columns</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">When it comes to <strong>non-schema-bound-views</strong> (NSB View)&nbsp;it is important to remember that <strong>there is no schema bound between objects used in the view and metadata for a view</strong>.</p>



<p class="wp-block-paragraph">Let&#8217;s look at the following scenario:</p>



<pre class="wp-block-preformatted"><pre class="brush: sql; title: ; notranslate">-- Create Table_1
CREATE TABLE dbo.Table_1 (Col_A int NULL, Col_B numeric(18, 0) NULL, Col_C nvarchar(50) NULL) ON &#x5B;PRIMARY]
GO;
--
-- Add data
INSERT dbo.Table_1 (Col_A, Col_B, Col_C) VALUES (10, 10.5, &#039;ABC&#039;);
INSERT dbo.Table_1 (Col_A, Col_B, Col_C) VALUES (20, 0.5, &#039;DEFG&#039;);
--
-- Create View
CREATE view &#x5B;dbo].&#x5B;vw_MyView] AS
SELECT TBL.*, (TBL.Col_A * TBL.Col_B) AS ColMult FROM dbo.Table_1 TBL
GO;</pre></pre>



<p class="wp-block-paragraph">An attempt to use the view would give the following result:</p>



<pre class="wp-block-preformatted"><pre class="brush: plain; title: ; notranslate">Col_A, Col_B, Col_C, ColMult
=================================
10, 10.5, ABC, 105
20, 0.5, DEFG, 10
</pre></pre>



<p class="wp-block-paragraph">So far we are OK. But &#8220;fun&#8221; starts when a new column is&nbsp;added to the table</p>



<p class="wp-block-paragraph"><strong>Case #1 &#8211; bad:</strong></p>



<pre class="wp-block-preformatted"><pre class="brush: sql; title: ; notranslate">ALTER TABLE dbo.Table_1 ADD Col_D nvarchar(10) NOT NULL DEFAULT &#039;A&#039;</pre></pre>



<p class="wp-block-paragraph">Result of the view:</p>



<pre class="wp-block-preformatted"><pre class="brush: plain; title: ; notranslate">Col_A, Col_B, Col_C, ColMult
=================================
10, 10.5, ABC, A
20, 0.5, DEFG, A</pre></pre>



<p class="wp-block-paragraph">Well&#8230; OK, it is not as bad as it seems since we would find the problem almost immediately in application since types of expected and returned data are incompatible. Bad situation, but manageable.</p>



<p class="wp-block-paragraph"><strong>Case #2 &#8211; catastrophic:<br /></strong></p>



<pre class="wp-block-preformatted"><pre class="brush: sql; title: ; notranslate">ALTER TABLE dbo.Table_1 ADD Col_D int NOT NULL DEFAULT 0</pre></pre>



<p class="wp-block-paragraph">Let&#8217;s look at the result now:</p>



<pre class="wp-block-preformatted"><pre class="brush: plain; title: ; notranslate">Col_A, Col_B, Col_C, ColMult
=================================
10, 10.5, ABC, 0
20, 0.5, DEFG, 0</pre></pre>



<p class="wp-block-paragraph">ColMult now contains 0 (zero)!!! If we have significant logic which relays on that, then big troubles are coming our way.<br />Now this is a catastrophic situation. And not easily visible. And of course work just fine on the Developer&#8217;s machine&#8230;<br />Testing&#8230; Testing&#8230; Testing&#8230;</p>



<p class="wp-block-paragraph"><strong>What just happened here?!!!</strong></p>



<p class="wp-block-paragraph">This is when knowing <strong>non-schema-bound-views</strong> definition is important. And let&#8217;s remember &#8211; this is the default state of any new view created.</p>



<p class="wp-block-paragraph">First, what is the difference between schema-bound views and not bound?<br />In order to create a schema-bound view special view attributes needs to be specified. Let&#8217;s adjust original view definition as following:</p>



<pre class="wp-block-preformatted"><pre class="brush: sql; title: ; notranslate">--&amp;amp;nbsp;Alter View
ALTER VIEW &#x5B;dbo].&#x5B;vw_MyView] WITH SCHEMABINDING
AS
SELECT TBL.*, (TBL.Col_A*TBL.Col_B) AS ColMult FROM Table_1 TBL</pre></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>SCHEMABINDING<br />Binds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the base table or tables cannot be modified in a way that would affect the view definition. The view definition itself must first be modified or dropped to remove dependencies on the table that is to be modified. When you use SCHEMABINDING, the select_statement must include the two-part names (schema.object) of tables, views, or user-defined functions that are referenced. All referenced objects must be in the same database.</p></blockquote>



<p class="wp-block-paragraph">If we try executing the script above to add the column error would occur: &#8220;Syntax &#8216;*&#8217; is not allowed in schema-bound objects.&#8221;</p>



<p class="wp-block-paragraph">As you can see from the definition of the attribute, the view needs to be defined explicitly with all columns listed. So if we were to have columns specified explicitly, then no problem would occur in the first place, and is considered a good practice.</p>



<p class="wp-block-paragraph">In our scenario above this is not an intent. Our view is designed to adjust itself to a table structure changes.<br />Inconvenience&#8230; or advantage&#8230; I let you decide.</p>



<p class="wp-block-paragraph"><strong>Finding a cure</strong></p>



<p class="wp-block-paragraph">Is there a way to fix the problem?</p>



<p class="wp-block-paragraph">A dirty way of forcing the view metadata to be refreshed would simply recreate the view using the original script, but imagine you have 30+ of them &#8211; Not good, time-consuming, and error-prone.</p>



<p class="wp-block-paragraph">There is a simple, universal and &#8220;human-error protected&#8221; way &#8211; after changes are applied to tables, simply refresh metadata of every view defined:</p>



<pre class="wp-block-preformatted"><pre class="brush: sql; title: ; notranslate">DECLARE @Table_Name varchar(120)
DECLARE Refresh_Views CURSOR FOR
SELECT Table_Name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = &#039;VIEW&#039; AND TABLE_SCHEMA = &#039;dbo&#039;
OPEN Refresh_Views
FETCH NEXT FROM Refresh_Views INTO @Table_Name
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC sp_refreshview @Table_Name
print &#039;refreshed View for: &#039; + @Table_Name
FETCH NEXT FROM Refresh_Views INTO @Table_Name
END
CLOSE Refresh_Views
DEALLOCATE Refresh_Views</pre></pre>



<p class="wp-block-paragraph">The script sp_refreshview would tell SQL Server to update the metadata for all non-schema-bound views in the current database.</p>



<p class="wp-block-paragraph"><strong>Note:</strong> Alternative: We can also use a more generic command &#8211; sp_refreshsqlmodule &#8211; which &#8220;updates the metadata for the specified non-schema-bound stored procedure, user-defined function, view, DML trigger, database-level DDL trigger, or server-level DDL trigger in the current database. Persistent metadata for these objects, such as data types of parameters, can become outdated because of changes to their underlying objects.&#8221; This may be even better since it would allow addressing any possible schema issues with any objects and not just views.</p>
<hr/><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span><p>The post <a href="https://blog.dragonsoft.us/2010/02/26/tables-views-missing-columns/">SQL Server: Tables, Views and missing columns</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2010/02/26/tables-views-missing-columns/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1109</post-id>	</item>
		<item>
		<title>SQL tasks automation: apply scripts from folder</title>
		<link>https://blog.dragonsoft.us/2009/12/02/sql-tasks-automation-apply-scripts-from-folder/</link>
					<comments>https://blog.dragonsoft.us/2009/12/02/sql-tasks-automation-apply-scripts-from-folder/#respond</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Thu, 03 Dec 2009 03:18:13 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[apply script]]></category>
		<category><![CDATA[apply sql script]]></category>
		<category><![CDATA[batch file]]></category>
		<category><![CDATA[osql]]></category>
		<category><![CDATA[sql automation]]></category>
		<category><![CDATA[sql script]]></category>
		<category><![CDATA[sql server]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=1008</guid>

					<description><![CDATA[<p>You will be amazed how common this question is: I have a folder with arbitrary set of SQL scripts and want to apply them all automatically. How do I do that? In other words: Having a folder &#8211; ex: C:\AutoSQLScripts &#8211; with some unknown set of SQL scripts And a SQL Instance where<a class="moretag" href="https://blog.dragonsoft.us/2009/12/02/sql-tasks-automation-apply-scripts-from-folder/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2009/12/02/sql-tasks-automation-apply-scripts-from-folder/">SQL tasks automation: apply scripts from folder</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>You will be amazed how common this question is:</p>
<blockquote><p><strong>I have a folder with arbitrary set of SQL scripts and want to apply them all automatically. How do I do that?</strong></p></blockquote>
<p>In other words:</p>
<ul>
<li>Having a folder &#8211; ex: C:\AutoSQLScripts &#8211; with some unknown set of SQL scripts</li>
<li>And a SQL Instance where scripts need to be applied</li>
<li>Run a scheduled task to perform the operation automatically.</li>
</ul>
<h3>Solution:</h3>
<p>First, lets figure out single operation &#8211; run SQL Script from command line in unattended mode using <strong><a href="http://msdn.microsoft.com/en-us/library/aa214012(SQL.80).aspx" target="_blank">osql</a></strong> utility:</p>
<pre class="brush: powershell; title: ; notranslate">::
osql -S MYSERVER -d MYDATABASE -E -i MySqlScript.sql  -o report.txt
::</pre>
<p>Where:</p>
<p><strong>-S</strong> indicates server name<br />
<strong>-d</strong> is an alternative to <em>USE db_name</em> inside the script<br />
<strong>-E</strong> indicates that trusted connection would be used<br />
<strong>-i</strong> identifies the file that contains a batch of SQL statements<br />
<strong>-o</strong> identifies the file that receives output from <strong>osql</strong></p>
<p>Simple so far&#8230;</p>
<p>Fun starts when we need to go through files in the folder. Using &#8220;magic&#8221; of Power Shell, it is also easy:</p>
<pre class="brush: powershell; title: ; notranslate">::
FOR /f &quot;TOKENS=*&quot; %%a IN ('dir /b &quot;%1*.sql&quot;') do ECHO %%a

::or

SET _PATH=%1
IF (NOT %_PATH%==&quot;&quot;) SET _PATH = '-p &quot;%_PATH%&quot;'
FORFILES %_PATH% -s -m *.* -c &quot;CMD /C ECHO @FILE&quot;
::</pre>
<p>Let&#8217;s ignore the end for now and concentrate on the syntax of the loop itself.</p>
<p><strong>FOR /f</strong> indicates that we need to perform a loop against a set of files specified in IN. To produce the set we are using <strong>&#8220;raw&#8221; dir </strong>of the folder, where %1 is, if specified, an input param of the batch file call.</p>
<p><strong>FORFILES</strong> is a little more complex and given here for comparison, yet produces the same result.</p>
<p><strong>Note: </strong><em>commands above work only with &#8220;local&#8221; (drive: based) locations. If you need apply scripts from Network folder, map it first as a local drive then apply scripts.</em></p>
<p>Now let&#8217;s combine SQL call with the batch processing and we would get the following <strong>ApplyScript.cmd</strong> which could be used to apply any scripts from current or specific folder to specified SQL Server/Database instance:</p>
<pre class="brush: powershell; title: ; notranslate">::
@ECHO OFF
SET _SERVER=MYSERVER
SET _DB=MYDATABASE

FOR /f &quot;TOKENS=*&quot; %%a IN ('dir /b %1*.sql') DO CALL osql -S %_SERVER% -d %_DB% -E -i %%a  -o report.txt
::</pre>
<p>Enjoy.</p>
<hr/>
<p><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span></p>
<p>The post <a href="https://blog.dragonsoft.us/2009/12/02/sql-tasks-automation-apply-scripts-from-folder/">SQL tasks automation: apply scripts from folder</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2009/12/02/sql-tasks-automation-apply-scripts-from-folder/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1008</post-id>	</item>
		<item>
		<title>SQL Server 2008: moving forward</title>
		<link>https://blog.dragonsoft.us/2009/01/09/sql-server-2008-moving-forward/</link>
					<comments>https://blog.dragonsoft.us/2009/01/09/sql-server-2008-moving-forward/#respond</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Fri, 09 Jan 2009 19:45:21 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[dts in sql server 2008]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<category><![CDATA[sql server 2008 data sheet]]></category>
		<category><![CDATA[sql server 2008 overview]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=764</guid>

					<description><![CDATA[<p>SQL Server 2008 has been available since Aug 6, 2008. This does not include CTP (Feb 2008) time-frame. We are close to the year milestone now. To my surprise there are still questions around if moving to a new version is necessary. This is especially difficult question to discuss/suggest when SQL<a class="moretag" href="https://blog.dragonsoft.us/2009/01/09/sql-server-2008-moving-forward/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2009/01/09/sql-server-2008-moving-forward/">SQL Server 2008: moving forward</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.microsoft.com/sqlserver/2008/en/us/default.aspx" target="_blank">SQL Server 2008</a> has been available since Aug 6, 2008. This does not include CTP (Feb 2008) time-frame.<br />
We are close to the year milestone now.</p>
<p>To my surprise there are still questions around if moving to a new version is necessary.</p>
<p>This is especially difficult question to discuss/suggest when SQL Server 2005 adoption cycle is just about being complete.</p>
<blockquote>
<ul>
<li>We all know about &#8220;have to wait until first SP is out&#8221; rule.</li>
<li>What is good about it to justify spending another chunk of IT budget?</li>
</ul>
</blockquote>
<p>To answer first question, there is a <a href="http://support.microsoft.com/kb/956717" target="_blank">cumulative update 1</a> available since Nov, 2008. One could count it as SP1.</p>
<p>To answer second question could be more difficult.</p>
<p>There is <a href="http://www.microsoft.com/sqlserver/2008/en/us/wp-sql-2008-overview.aspx" target="_blank">Product Overview</a> <a href="http://download.microsoft.com/download/6/9/d/69d1fea7-5b42-437a-b3ba-a4ad13e34ef6/SQL2008_ProductOverview.docx" target="_blank">White Paper</a> available along with <a href="http://download.microsoft.com/download/B/F/2/BF24C54E-5635-4C79-AFB4-0C3F840E79F4/SQLServer2008_Datasheet_Final.pdf" target="_blank">Data sheet</a> where main differences between 2005 and 2008 versions are highlighted.</p>
<p>As you could see many features are enterprise level, but many are to make life regular developers easier as well.</p>
<p>To summarise, while SQL Server 2008 could be considered just an extension to 2005, major enhancements are:</p>
<ol>
<li><strong>Transparent Data Encryption</strong> &#8211; add protection to your data storage without custom and usually process extensive solutions</li>
<li><strong>External Key Management</strong> &#8211; integrate 3rd party security keys and hardware</li>
<li><strong>Enhanced Auditing</strong> &#8211; monitor data access and modification</li>
<li><strong>Advanced Database Mirroring</strong> &#8211; data corruption protection, improved performance, new performance counters</li>
<li><strong>Hot CPU management</strong> &#8211; change hardware configurations without downtime (for supported hardware platforms)</li>
<li><strong>Performance improvements, Service Broker Scalability, Integrated Full-Text Search, Sparse Columns (&#8220;zero storage&#8221;), no 8,000 byte limit </strong>&#8211; manage allocated resources and priorities, query plans optimizations, data compression, backup compression (finally <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ), extended performance monitoring tools, 64 bit platform optimization (RAM, hardware, etc)</li>
<li><strong>SQL Server Integration Services (SSIS)</strong> improvements</li>
<li><strong>Policy-Based Management</strong></li>
<li><strong>Installation improvements</strong></li>
<li><strong>ADO.Net Entity Framework and CLR Integration</strong> &#8211; Object-Oriented style support instead of Table/Field approach</li>
<li><strong>LINQ</strong> &#8211; even though some pieces (?temporary solutions?) were available before, now LINQ becomes first-class citizen for SQL Server. Forget your T-SQL and program using LINQ syntax.</li>
<li><strong>T-SQL improvements</strong> &#8211; even though LINQ may be a way to go, T-SQL still is not forgotten with added support for <em>Table Value Parameters (TVP)</em>, <em>Object Dependencies Views and Functions</em>, new data types<em>: DATE, TIME, DATETIMEOFFSET, DATETIME2</em> allowing conserve storage space and improve time precision, <em>FILESTREAM, GEOGRAPHY</em> and <em>GEOMETRY </em> datatypes, and <em>HIERARCHYID</em> for better support of tree based data structures<br />
<strong>Compound operators</strong> &#8211; lovely &#8220;+=&#8221; syntax and <strong>in-line variable assignment </strong>DECLARE @myVar int = 5<br />
<strong>MERGE </strong>support &#8211; manage data inserts/updates in one SQL statement</li>
<li><strong>SQL Management Studio gets IntelliSense</strong> and other improvements and better Source Control integration</li>
<li><strong>SQL Management Studio T-SQL debugging</strong> &#8211; not as robust as it is in Visual Studio, but sufficient in many situations.</li>
<li><strong>Table Partitioning management</strong></li>
<li><strong>Hot-swap data connectors</strong> &#8211; easier support for disconnected data applications</li>
<li><strong>Improved MS Reporting Services and report builder</strong>&#8211; MS Word/Excel/SharePoint integration improved</li>
<li><strong>OLAP support improvements</strong></li>
</ol>
<p>Even if you decided to stay with 2000/2005 version, keep in mind a few things which will make your future upgrades easier.</p>
<p><strong>The list of features dropped/changed in SQL Server 2008.</strong></p>
<ol>
<li><strong>Deprecated SQL Server Features in SQL Server 2008</strong>
<ul>
<li>DTS support (<a href="http://msdn.microsoft.com/en-us/library/bb500440.aspx" target="_blank">link</a>) is replaced with SSIS (<a href="http://blog.scalabilityexperts.com/2008/02/14/the-key-sql-server-2008-bi-migration-dts-to-ssis-2008-part-1-of-2/" target="_blank">migration</a>)</li>
<li>ADHelper service</li>
<li>SOAP/HTTP endpoints, sys.http_endpoints, sys.endpoint_webmethods (Transact-SQL)</li>
</ul>
</li>
<li><strong>Discontinued SQL Server Features in SQL Server 2008</strong>
<ul>
<li>Some SMO Classes has been discontinued</li>
<li>Surface Area Configuration Tool (SAC)</li>
<li>Discontinued Command Prompt Parameters for SQL Server Setup</li>
</ul>
</li>
<li><strong>SQL Server Native Client has been upgraded with some behavior changes</strong></li>
</ol>
<p>How about some technical data and stats? To begin with, Microsoft team is no longer publicly presents any data which will show some benchmarks between versions, editions or between different database server platforms, so we have to relay on someone outside do the job.</p>
<p>Yes, comming with mathematical background I can agree with some arguments that this data is not accurate and always represent just what was tested in each particular case in each particular hardware configuration. With statistics being used by marketing department it can be very interesting.</p>
<p>Therefore, we have to be very sceptical about any stats presented anywhere. Nevertheless:</p>
<ul>
<li>Microsoft:
<ul>
<li><a href="http://www.microsoft.com/sqlserver/2008/en/us/compare.aspx" target="_blank">Microsoft SQL Server 2008: Compare</a> or count your money</li>
<li><a href="http://blogs.msdn.com/mattm/archive/2008/08/19/competitive-comparison-of-sql-server-2008-integration-services.aspx" target="_blank">Competitive Comparison of SQL Server 2008 Integration Services</a> by SSIS Team</li>
</ul>
</li>
<li>Some 3rd party data:
<ul>
<li>Count your time or <a href="http://sqlblog.com/blogs/joe_chang/archive/2008/08/17/large-query-performance-from-sql-server-2000-to-2008-32-64-bit.aspx" target="_blank">Large Query Performance from SQL Server 2000 to 2008, 32 &amp; 64-bit</a></li>
<li>Compare features or<span class="headertitle"> <a href="http://www.bostongis.com/PrinterFriendly.aspx?content_name=sqlserver2008_postgis_mysql_compare" target="_blank">Cross Compare SQL Server 2008 Spatial, PostgreSQL/PostGIS 1.3-1.4, MySQL 5-6</a></span></li>
</ul>
</li>
</ul>
<p>As far as my own experience with a new version &#8211; it has been positive and I would highly recommend to go with this upgrade.</p>
<hr/>
<p><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span></p>
<p>The post <a href="https://blog.dragonsoft.us/2009/01/09/sql-server-2008-moving-forward/">SQL Server 2008: moving forward</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2009/01/09/sql-server-2008-moving-forward/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">764</post-id>	</item>
		<item>
		<title>TIP: Installing SQL Server 2008 &#8211; reboot required check fails</title>
		<link>https://blog.dragonsoft.us/2008/11/08/tip-installing-sql-server-2008-reboot-required-check-fails/</link>
					<comments>https://blog.dragonsoft.us/2008/11/08/tip-installing-sql-server-2008-reboot-required-check-fails/#comments</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Sat, 08 Nov 2008 17:17:50 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[install problem]]></category>
		<category><![CDATA[PendingFileRenameOperations]]></category>
		<category><![CDATA[reboot required check]]></category>
		<category><![CDATA[reboot required check failed]]></category>
		<category><![CDATA[rebootrequiredcheck]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<category><![CDATA[windows installer]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=595</guid>

					<description><![CDATA[<p>When installing SQL Server 2008 one can run into &#8220;&#8216;Reboot required check failed&#8221; situation. After seeing it few times already, I think a solution is worth mentioning. &#8220;Why don&#8217;t you just reboot?&#8221;, you say&#8230; Well, most likely it would not help you, but try it first. If this would not<a class="moretag" href="https://blog.dragonsoft.us/2008/11/08/tip-installing-sql-server-2008-reboot-required-check-fails/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/11/08/tip-installing-sql-server-2008-reboot-required-check-fails/">TIP: Installing SQL Server 2008 &#8211; reboot required check fails</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>When installing SQL Server 2008 one can run into &#8220;&#8216;Reboot required check failed&#8221; situation.</p>
<p>After seeing it few times already, I think a solution is worth mentioning.</p>
<p>&#8220;Why don&#8217;t you just reboot?&#8221;, you say&#8230; Well, most likely it would not help you, but try it first.<br />
If this would not help, then try the following:</p>
<ol>
<li>Start regedit.exe</li>
<li>Navigate to <strong>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager</strong></li>
<li>Locate PendingFileRenameOperations</li>
<li>Remove any data associated with the value (you may want to export the value for later review)</li>
<li>Reboot and rerun installation, check should pass.</li>
</ol>
<p><strong>Update. </strong>As a respond to some comments about solution above not always work you may consider the following:</p>
<ul>
<li>Make sure that after you reboot entry in the registry does not reappear.<br />
If it does, remove it again, but do not reboot, just go ahead with installation process and click &#8220;ReRun&#8221;. Most likely you would be fine now.</li>
<li>You may also try and see that other <em><strong>ControlSet001, ControlSet002</strong>, etc</em> do not suffer from the same problem (solution mentioned by Mike Hills below).</li>
<li>There was mentioning that some installations of Visual Studio 2008 could cause check to fail as well. So if nothing from above helped, uninstall Visual Studio (comes with light version of SQL Server), install SQL Server and then reinstall Visual Studio again.</li>
</ul>
<p>Lets see why would entry reappear&#8230; This may happen if there is a driver or application which supports &#8220;recovery&#8221; mode or plain virus is around and after reboot it is trying to finish the deployment process again. In any situation try and look closer: what app file belongs to, if there are other solutions to the problem so that original process would finish properly, etc.</p>
<p><em>Update: </em>Recently I was working on the unrelated setup automation for Visual Studio and stepped on a hidden gem which may work here as well: when running setup from command prompt, Windows Installer accepts a parameter called <em>SkipRules</em>. It worth mention the following &#8220;<a href="http://technet.microsoft.com/en-us/library/ms144259.aspx" target="_blank">How to: Install SQL Server 2008 from the Command Prompt</a>&#8221; first and then look at desired parameter</p>
<blockquote><p>/SkipRules=VSShellInstalledRule RebootRequiredCheck</p></blockquote>
<p>We can ignore first rule, since it is VS related, but second is the one you may want to try.</p>
<hr/>
<p><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/11/08/tip-installing-sql-server-2008-reboot-required-check-fails/">TIP: Installing SQL Server 2008 &#8211; reboot required check fails</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2008/11/08/tip-installing-sql-server-2008-reboot-required-check-fails/feed/</wfw:commentRss>
			<slash:comments>31</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">595</post-id>	</item>
		<item>
		<title>Tip: Get list of columns for the table</title>
		<link>https://blog.dragonsoft.us/2008/05/12/tip-get-list-of-columns-for-the-table/</link>
					<comments>https://blog.dragonsoft.us/2008/05/12/tip-get-list-of-columns-for-the-table/#respond</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Mon, 12 May 2008 20:26:47 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[list of columns]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[table]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=180</guid>

					<description><![CDATA[<p>When you dealing with dynamic SQL or unknown table structure, SQL meta data could help recover the missing information. There are two main system tables which give you such information: dbo.sysobjects dbo.syscolumns Example below shows how to gather column list for specified table. DECLARE @TABLENAME varchar(256), @COLUMNS varchar(4000) SET @TABLENAME<a class="moretag" href="https://blog.dragonsoft.us/2008/05/12/tip-get-list-of-columns-for-the-table/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/05/12/tip-get-list-of-columns-for-the-table/">Tip: Get list of columns for the table</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>When you dealing with dynamic SQL or unknown table structure, SQL meta data could help recover the missing information.</p>
<p>There are two main system tables which give you such information:</p>
<ul>
<li>dbo.sysobjects</li>
<li>dbo.syscolumns</li>
</ul>
<p>Example below shows how to gather column list for specified table.</p>
<pre class="brush: sql; title: ; notranslate">DECLARE
  @TABLENAME varchar(256),
  @COLUMNS varchar(4000)

SET @TABLENAME = &#039;mytable&#039;
SET @COLUMNS = &#039;&#039;

SELECT @COLUMNS = @COLUMNS + c.name + &#039;, &#039;
FROM syscolumns c
INNER JOIN sysobjects o ON o.id = c.id
WHERE o.name = @TABLENAME AND o.xtype=&#039;U&#039;
ORDER BY colid

SET @COLUMNS = SUBSTRING(@COLUMNS, 1, Datalength(@COLUMNS) - 2)

SELECT @COLUMNS</pre>
<p>or if you prefer more generic approach</p>
<pre class="brush: sql; title: ; notranslate">DECLARE
  @TABLENAME varchar(256),
  @COLUMNS varchar(4000)

SET @TABLENAME = &#039;mytable&#039;
SET @COLUMNS = &#039;&#039;

SET @COLUMNS = &#039;&#039;
SELECT @COLUMNS = @COLUMNS + COLUMN_NAME + &#039;, &#039;
FROM INFORMATION_SCHEMA.Columns
WHERE TABLE_NAME = @TABLENAME
ORDER BY ORDINAL_POSITION

SET @COLUMNS = SUBSTRING(@COLUMNS, 1, Datalength(@COLUMNS) - 2)
SELECT @COLUMNS</pre>
<p>Result is a coma-separated list of columns in the table in order they appear.</p>
<p><strong>Note</strong>. Check for xtype in the first example could be useful but not required, since you probably do not mix table name with any other object names. Otherwise, it would be necessary to ensure that you are looking at the table and not something else.<br />
Other possible values for this column are:</p>
<ul>
<li><strong>S</strong> &#8211; System tables</li>
<li><strong>U</strong> &#8211; User table</li>
<li><strong>TR</strong> &#8211; Triggers</li>
<li><strong>P</strong> &#8211; Stored procedure</li>
<li><strong>RF</strong> &#8211; Replication filter stored procedure</li>
<li><strong>X</strong> &#8211; Extended stored procedure</li>
<li><strong>V</strong> &#8211; View</li>
<li><strong>TF</strong> &#8211; Functions</li>
<li><strong>C</strong> &#8211; CHECK constraint</li>
<li><strong>D</strong> &#8211; DEFAULT constraint</li>
<li><strong>F</strong> &#8211; FOREIGN KEY constraint</li>
<li><strong>PK</strong> &#8211; PRIMARY KEY constraint (type is K)</li>
<li><strong>UQ</strong> &#8211; UNIQUE constraint (type is K)</li>
<li><strong>L</strong> &#8211; Log</li>
</ul>
<hr/>
<p><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/05/12/tip-get-list-of-columns-for-the-table/">Tip: Get list of columns for the table</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2008/05/12/tip-get-list-of-columns-for-the-table/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">180</post-id>	</item>
		<item>
		<title>SQL date operations: Last 90 days, Get Date from DateTime&#8230;</title>
		<link>https://blog.dragonsoft.us/2008/05/12/sql-date-operations-last-90-days-get-date-from-datetime/</link>
					<comments>https://blog.dragonsoft.us/2008/05/12/sql-date-operations-last-90-days-get-date-from-datetime/#respond</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Mon, 12 May 2008 20:14:16 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[date manipulations]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql server]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=179</guid>

					<description><![CDATA[<p>I am continuing putting some common examples of operations for Microsoft SQL Server. In addition to some of the Date related code snippets published before, there are few more today: -- Last 90 days: select DATEADD(day, -90, GETDATE()) -- Get Date portion of DateTime value select DATEADD(d, 0, DATEDIFF(d, 0,<a class="moretag" href="https://blog.dragonsoft.us/2008/05/12/sql-date-operations-last-90-days-get-date-from-datetime/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/05/12/sql-date-operations-last-90-days-get-date-from-datetime/">SQL date operations: Last 90 days, Get Date from DateTime&#8230;</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I am continuing putting some common examples of operations for Microsoft SQL Server.<br />
In addition to some of the Date related code snippets <a href="http://blog.dragonsoft.us/2008/02/05/first-day-last-day-of-the-month-and-sql/" target="_self">published before</a>, there are few more today:</p>
<pre class="brush: sql; title: ; notranslate">-- Last 90 days:
select DATEADD(day, -90, GETDATE())
-- Get Date portion of DateTime value
select DATEADD(d, 0, DATEDIFF(d, 0, getdate()))
</pre>
<hr/>
<p><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/05/12/sql-date-operations-last-90-days-get-date-from-datetime/">SQL date operations: Last 90 days, Get Date from DateTime&#8230;</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2008/05/12/sql-date-operations-last-90-days-get-date-from-datetime/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">179</post-id>	</item>
		<item>
		<title>SQL Server Collation. An enemy or a friend?</title>
		<link>https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/</link>
					<comments>https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/#comments</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Wed, 16 Apr 2008 00:51:35 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[change database collation]]></category>
		<category><![CDATA[collation]]></category>
		<category><![CDATA[collationname]]></category>
		<category><![CDATA[sql server]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=167</guid>

					<description><![CDATA[<p>Is SQL Server Collation setting your enemy or your friend? How to change server default collation? In general, it is your friend, it will help SQL Server to figure out how to store character strings in different locale. It becomes even more important when data you are storing goes beyond<a class="moretag" href="https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/">SQL Server Collation. An enemy or a friend?</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Is SQL Server Collation setting your enemy or your friend? How to change server default collation?</p>
<p>In general, it is your friend, it will help SQL Server to figure out how to store character strings in different locale. It becomes even more important when data you are storing goes beyond regular ANSI charset (Chinese, Japanese, etc.).</p>
<p>In my case I, from time to time work with Cyrillic. Being born and raised in Russia, I am native Russian speaker. As a result I am keeping Cyrillic enabled on my machine as main locale setting.</p>
<p>It is OK in many instances, but when it comes to SQL Server or some other applications which are trying to be smart in this area, it becomes a problem.</p>
<p>If you install SQL Server instance in such environment, you would get something like that</p>
<p>Let check collation for some database I have</p>
<pre class="brush: sql; title: ; notranslate">SELECT databasepropertyex(db_name(),'collation') AS collation_name</pre>
<p>In my case result would be</p>
<p> Cyrillic_General_CI_AS</p>
<p>If you are at home, it may be fine, but at work when your primary locale is SQL_Latin1_General_CP1_CI_AS<br />
it could be a problem since you often will run into error when execution of the SQL code across different databases will return Collation error.</p>
<p>Too late? Not exactly.</p>
<p>In many cases your solution would be to adjust Collation setting for the database using to following code:</p>
<pre class="brush: sql; title: ; notranslate">ALTER DATABASE DatabaseName COLLATE SQL_Latin1_General_CP1_CI_AS</pre>
<p>Problem would still exist though, any new database created will get default Collation setting from &#8230; MASTER database for your SQL Server Instance.</p>
<p> And here some hoops will be required. Following steps will help you overcome the issue:</p>
<ol>
<li>Detach all your user databases</li>
<li>Stop your SQL Server</li>
<li>In <strong>C:\Program Files\Microsoft SQL Server\80\Tools\Binn\</strong> folder locate <strong>rebuildm.exe</strong> and run it. This utility which comes with SQL Server (you will need to have client tools to be installed) allows you to repair your master database from original installation CD/DVD/Folder and also change default Collation Setting for your SQL Server instance. Go to Settings and choose appropriate collation designator or SQL Collation.<br />
If you cannot find rebuildm.exe, it means you are using SQL Server 2005 or 2008. Then the following may help:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms144259(SQL.90).aspx" target="_blank">for SQL Server 2005</a></p>
<pre class="brush: plain; title: ; notranslate">
start /wait &lt;CD or DVD Drive&gt;\setup.exe /qn INSTANCENAME=&lt;InstanceName&gt; REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=&lt;NewStrongPassword&gt;</pre>
<p><a href="http://blogs.msdn.com/psssql/archive/2008/08/29/how-to-rebuild-system-databases-in-sql-server-2008.aspx" target="_blank">for SQL Server 2008</a></p>
<pre class="brush: plain; title: ; notranslate">
setup.exe  /QUIET  /ACTION=REBUILDDATABASE  /INSTANCENAME=instance_name  /SQLSYSADMINACCOUNTS= accounts   &#x5B;/SAPWD=password]
</pre>
</li>
<li>Rebuild your master database</li>
<li>Reattach your user databases</li>
<li>Check that collation for master and user databases is a desired using first query above.</li>
</ol>
<p>This is much easier then to recreate a SQL Server instance from scratch.</p>
<p><strong>Note. </strong>There is less safe way of getting the same result &#8211; adjust Windows Registry.<br />
Your default collation name is stored under</p>
<pre class="brush: sql; title: ; notranslate">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\
DefaultCollationName</pre>
<hr/>
<p><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/">SQL Server Collation. An enemy or a friend?</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">167</post-id>	</item>
		<item>
		<title>Load text file data into SQL Server table</title>
		<link>https://blog.dragonsoft.us/2008/03/06/load-text-file-data-into-sql-server-table/</link>
					<comments>https://blog.dragonsoft.us/2008/03/06/load-text-file-data-into-sql-server-table/#respond</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Thu, 06 Mar 2008 17:36:40 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[import csv]]></category>
		<category><![CDATA[import text file]]></category>
		<category><![CDATA[sql server]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/2008/03/06/load-text-file-data-into-sql-server-table/</guid>

					<description><![CDATA[<p>Last time we have seen how to manipulate text files from SQL Server code using Scripting object. This time we would look at &#8220;Read File As Table&#8221; operation from a different angle &#8211; using BULK INSERT operation. There are pros and cons in this approach. Lets look at them. Advantages: Getting<a class="moretag" href="https://blog.dragonsoft.us/2008/03/06/load-text-file-data-into-sql-server-table/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/03/06/load-text-file-data-into-sql-server-table/">Load text file data into SQL Server table</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Last time we have seen how to <a href="http://blog.dragonsoft.us/2008/02/15/sql-manage-files-from-inside-sql-code/">manipulate text files from SQL Server</a> code using Scripting object.</p>
<p>This time we would look at &#8220;<strong>Read File As Table</strong>&#8221; operation from a different angle &#8211; using BULK INSERT operation.</p>
<p>There are pros and cons in this approach. Lets look at them.</p>
<p>Advantages:</p>
<ul>
<li>Getting data in table format, with properly associated columns</li>
<li>BULK INSERT is quicker operation if you know what you are importing</li>
<li>IDENTITY INSERT and other Batch optimizers</li>
<li>Transaction support</li>
<li>Is easiest way to copy data between servers</li>
</ul>
<p>Disadvantages:</p>
<ul>
<li>it is supported for variation of CSV formatted files only</li>
<li>structure of the file is strict and small error in formatting or a hidden character can cause problems with import</li>
<li>only members of the <strong>sysadmin</strong> and <strong>bulkadmin</strong> server roles can perform an operation</li>
<li>could be messy if not properly managed.</li>
</ul>
<p>All saying, you should always try and see if it works for you, instead of creating custom import procedures or using DTS functionality.</p>
<p>Let fun begins:</p>
<p>We would be working with the following table:</p>
<pre class="brush: sql; title: ; notranslate">CREATE TABLE StoreList (
StoreID INT,
StoreName VARCHAR(32),
  City VARCHAR(32),
  State VARCHAR(2),
  Country VARCHAR(32)
)</pre>
<p>Sample data we would be using is stored in CSV file called c:\stores.csv</p>
<pre>1111,Stone Age Books,Boston,MA,USA
2222,Harley &amp; Davidson,Washington,DC,USA
3333,Infodata Algosystems,Berkeley,CA,USA</pre>
<p>When table is created Bulk insert could be performed using the following command:</p>
<pre class="brush: sql; title: ; notranslate">BULK INSERT dbo.StoreList FROM &#039;c:\stores.csv&#039; WITH (
   FIELDTERMINATOR = &#039;,&#039;,
   ROWTERMINATOR = &#039;\n&#039;
)
</pre>
<p>Notice that we are using coma as separator, it might not be appropriate in some situations and could be easily addressed for let say TAB-separated values using</p>
<pre class="brush: sql; title: ; notranslate">BULK INSERT dbo.StoreList FROM &#039;c:\stores.csv&#039;
WITH (
   ROWTERMINATOR = &#039;\n&#039;
)</pre>
<p>As you can see that FIELDTERMINATOR has been removed. This is a case because &#8216;\t&#8217; value otherwise used here is a default for the parameter. You can adjust Field and Row terminators to better suite format present in the file in each case.</p>
<p>Another thing to remember that some of the files, especially results from Excel export might include header rows which might make your import fail with conversion error</p>
<blockquote><p>Bulk insert data conversion error (type mismatch) for&#8230;</p></blockquote>
<p>To address the issue simply exclude header related rows from import</p>
<pre class="brush: sql; title: ; notranslate">BULK INSERT dbo.StoreList FROM &#039;c:\stores.csv&#039;
WITH (
    FIRSTROW = 2,
    ROWTERMINATOR = &#039;\n&#039;
)
</pre>
<p>There are other settings which might affect bulk import:</p>
<ul>
<li>Turning Insert Triggers On while performing import</li>
<li>Keep NULL values &#8211; situation when there is nothing specified between delimiters</li>
<li>specifying LASTROW of the file to import</li>
<li>how many error to ignore when found in the file before invalidating a whole import</li>
</ul>
<p>Please refer to SQL Server Book Online for details about such settings.</p>
<hr/>
<p><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/03/06/load-text-file-data-into-sql-server-table/">Load text file data into SQL Server table</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2008/03/06/load-text-file-data-into-sql-server-table/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">153</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Minified using Disk
Database Caching 32/96 queries in 0.060 seconds using Disk

Served from: blog.dragonsoft.us @ 2026-05-25 08:13:36 by W3 Total Cache
-->