<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Ramoji Ryali's Fundas</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ramoji/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ramoji/feed.xml</link>
    <description>The interesting things I experimented with SQl Server.</description>
    <lastBuildDate>Wed, 08 Apr 2015 16:06:15 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Could not load package because of error 0xC0011002. Failed to open package file due to error 0x80070005 "Access is denied."</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/could-not-load-package-because-of-error-0xc0011002-failed-to-open-package-file-due-to-error-0x80070005-access-is-denied</link>
      <pubDate>Thu, 06 Jan 2011 05:23:00 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2011/01/06/could-not-load-package-because-of-error-0xc0011002-failed-to-open-package-file-due-to-error-0x80070005-access-is-denied/</guid>
      <description><![CDATA[Came across this error while executing a SSIS package through a SQL Agent Job on a SQL Server 2008...]]></description>
      <content:encoded><![CDATA[<p>Came across this error while executing a SSIS package through a SQL Agent Job on a SQL Server 2008 server.The job is running under a windows security account and the SSIS package is stored on file system of the server.</p>
<p>The exact error message received was as shown below.</p>
<p>Executed as user: Domain\User. Microsoft (R) SQL Server Execute Package Utility&nbsp; Version 10.50.1600.1 for 64-bit&nbsp; Copyright (C) Microsoft Corporation 2010. All rights reserved.&nbsp;&nbsp;&nbsp; Started:&nbsp; 11:11:37 PM&nbsp; Error: 2011-01-03 23:11:37.14&nbsp;&nbsp;&nbsp;&nbsp; Code: 0xC0011007&nbsp;&nbsp;&nbsp;&nbsp; Source: {1BDBB290-5831-476E-97F5-78DA45F876F4}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description: Unable to load the package as XML because of package does not have a valid XML format. A specific XML parser error will be posted.&nbsp; End Error&nbsp; Error: 2011-01-03 23:11:37.14&nbsp;&nbsp;&nbsp;&nbsp; Code: 0xC0011002&nbsp;&nbsp;&nbsp;&nbsp; Source: {1BDBB290-5831-476E-97F5-78DA45F876F4}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description: Failed to open package file "C:\SSIS\MyPackage.dtsx" due to error 0x80070005 "Access is denied.".&nbsp; This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.&nbsp; End Error&nbsp; <i><b>Could not load package "D:\SSIS\MyPackage.dtsx" because of error 0xC0011002.&nbsp; Description: Failed to open package file "D:\SSIS\MyPackage.dtsx" due to error 0x80070005 "Access is denied."</b></i>.&nbsp; This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.&nbsp; Source: {1BDBB290-5831-476E-97F5-78DA45F876F4}&nbsp; Started:&nbsp; 11:11:37 PM&nbsp; Finished: 11:11:37 PM&nbsp; Elapsed:&nbsp; 0.031 seconds.&nbsp; Process Exit Code 4.&nbsp; .&nbsp; NOTE: The step was retried the requested number of times (5) without succeeding.&nbsp; The step failed.</p>
<p>&nbsp;</p>
<p>Since the error message is talking about access, verified whether the security account with which SQL Agent Service is running has access to the server folder in which SSIS package is stored. Noticed that the security account doesn't have the access and the job started working after giving the read &amp; write permission on the folder.</p>
<p>Let me know if this has helped you.</p>]]></content:encoded>
    </item>
    <item>
      <title>Comparing data between two tables in SQL Server</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/comparing-data-between-two-tables-in-sql-server</link>
      <pubDate>Thu, 01 Jul 2010 06:58:00 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2010/07/01/comparing-data-between-two-tables-in-sql-server/</guid>
      <description><![CDATA[As a database developer sometime or the other you might have come across this requirement and it can...]]></description>
      <content:encoded><![CDATA[<p>As a database developer sometime or the other you might have come across this requirement and it can be achieved using many ways including built-in features like Checksum and TableDiff utility.&nbsp;However, I would like to share an alternate&nbsp;way to achieve the objective, which might be useful in some situations.</p>
<p>Usually&nbsp;the intention of&nbsp;comparison is to find out the missing rows from either of the tables or both. This where the operator "EXCEPT" comes very handy. Let us see&nbsp;it with an example.</p>
<p><span style="color: #008000; font-size: x-small;"><span style="color: #008000; font-size: x-small;"><span style="color: #008000; font-size: x-small;"><span style="color: #008000; font-size: x-small;"></span></span>
<p>&nbsp;--Create two Tables--</p>
<p><span style="color: #0000ff;">CREATE TABLE TableA(ID Int, Name Varchar(256))</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p><span style="color: #0000ff;">CREATE TABLE TableB(ID Int, Name Varchar(256))</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p><span style="color: #0000ff;">INSERT INTO TableA VALUES(1,'A'),(2,'B'),(3,'D')</span></p>
<p><span style="color: #0000ff;">INSERT INTO TableB VALUES(1,'A'),(2,NULL),(3,'C')</span></p>
<p>--Get rows from TableA that are not found in TableB--</p>
<p><span style="color: #0000ff;">SELECT * FROM TableA</span></p>
<p><span style="color: #0000ff;">EXCEPT</span></p>
<p><span style="color: #0000ff;">SELECT * FROM TableB</span></p>
<p>--Get rows from TableB that are not found in TableA--</p>
<p><span style="color: #0000ff;">SELECT * FROM TableB</span></p>
<p><span style="color: #0000ff;">EXCEPT</span></p>
<p><span style="color: #0000ff;">SELECT * FROM TableA</span></p>
<p>
<p>&nbsp;</p>
</p>
</span></span>I have used the above concept for comparing data between heavy tables and the performance is satisfactory. I could get the result in 3 Min 55 sec when I compared a table having 1.18 million rows. The comparison can't be performed for some of the data types of the columns like XML, Text and Image etc. So, I have written a generic stored procedure that does the comparison between two tables by excluding the columns that can't be compared. It also allows to compare tables across databases and schemas. Validations and error handling are not added as the intention is to just present the idea.</p>
<p>
<p>----------------------------------------------------------------------------------------------------------------------</p>
<p><span style="color: #0000ff;">CREATE PROCEDURE CompareTableData</span></p>
<p><span style="color: #0000ff;">(</span></p>
<p><span style="color: #0000ff;">@SourceDB sysname</span></p>
<p><span style="color: #0000ff;">,@SourceSchema sysname</span></p>
<p><span style="color: #0000ff;">,@SourceTable sysname</span></p>
<p><span style="color: #0000ff;">,@TargetDB sysname</span></p>
<p><span style="color: #0000ff;">,@TargetSchema sysname</span></p>
<p><span style="color: #0000ff;">,@TargetTable sysname</span></p>
<p><span style="color: #0000ff;">)</span></p>
<p><span style="color: #0000ff;">AS</span></p>
<p><span style="color: #0000ff;">BEGIN</span></p>
<p><span style="color: #0000ff;">SET NOCOUNT ON</span></p>
<p><span style="color: #0000ff;">DECLARE @SQL NVarchar(Max)</span></p>
<p><span style="color: #0000ff;">DECLARE @ColList Varchar(Max)</span></p>
<p><span style="color: #008000;">--Concatenate the column list by excluding the data types that can't be used in comparision--</span></p>
<p><span style="color: #0000ff;">SET @SQL = 'SELECT @ColList = CASE WHEN @ColList IS NULL THEN '''' ELSE @ColList + '','' END + SC.Name FROM ' + @SourceDB + '.sys.columns SC '</span></p>
<p><span style="color: #0000ff;">SET @SQL = @SQL + ' INNER JOIN ' + @SourceDB + '.sys.Types ST ON SC.system_type_id = ST.system_type_id WHERE object_id = object_id(@SourceTable) '</span></p>
<p><span style="color: #0000ff;">SET @SQL = @SQL + ' AND ST.Name NOT IN (''xml'',''Text'',''Image'',''Geometry'',''Geography'')'</span></p>
<p><span style="color: #0000ff;">EXEC sp_executesql @SQL,N'@ColList varchar(Max) OUTPUT,@SourceTable sysname',@ColList OUTPUT,@Sourcetable</span></p>
<p><span style="color: #008000;">--Get the rows that are missing from Target table--</span></p>
<p><span style="color: #0000ff;">SET @SQL = 'SELECT ''' + @TargetTable + ''' as RowMissingFrom,' + @ColList + ' FROM ' + @SourceDB + '.' + @SourceSchema + '.' + @SourceTable</span></p>
<p><span style="color: #0000ff;">SET @SQL = @SQL + ' EXCEPT '</span></p>
<p><span style="color: #0000ff;">SET @SQL = @SQL + ' SELECT ''' + @TargetTable + ''' as RowMissingFrom,' + @ColList + ' FROM ' + @TargetDB + '.' + @TargetSchema + '.' + @TargetTable</span></p>
<p><span style="color: #0000ff;">EXEC sp_executesql @SQL,N'@ColList varchar(Max)',@ColList</span></p>
<p><span style="color: #008000;">--Get the rows that are missing from Source table--</span></p>
<p><span style="color: #0000ff;">SET @SQL = ' SELECT ''' + @SourceTable + ''' as RowMissingFrom,' + @ColList + ' FROM ' + @TargetDB + '.' + @TargetSchema + '.' + @TargetTable</span></p>
<p><span style="color: #0000ff;">SET @SQL = @SQL + ' EXCEPT '</span></p>
<p><span style="color: #0000ff;">SET @SQL = @SQL + 'SELECT ''' + @SourceTable + ''' as RowMissingFrom,' + @ColList + ' FROM ' + @SourceDB + '.' + @SourceSchema + '.' + @SourceTable</span></p>
<p><span style="color: #0000ff;">EXEC sp_executesql @SQL,N'@ColList varchar(Max)',@ColList </span></p>
<p><span style="color: #0000ff;">END</span></p>
<p>-----------------------------------------------------------------------------------------------------------</p>
<p>Sample usgae of&nbsp;the procedure&nbsp;is:&nbsp;&nbsp;<span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">EXEC&nbsp;</span></span><span style="font-size: x-small;"> CompareTableData</span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;"> </span></span><span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;">'DB1'</span></span><span style="color: #808080; font-size: x-small;"><span style="color: #808080; font-size: x-small;">,</span></span><span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;">'dbo'</span></span><span style="color: #808080; font-size: x-small;"><span style="color: #808080; font-size: x-small;">,</span></span><span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;">'TableA'</span></span><span style="color: #808080; font-size: x-small;"><span style="color: #808080; font-size: x-small;">,</span></span><span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;">'DB2'</span></span><span style="color: #808080; font-size: x-small;"><span style="color: #808080; font-size: x-small;">,</span></span><span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;">'HR'</span></span><span style="color: #808080; font-size: x-small;"><span style="color: #808080; font-size: x-small;">,</span></span><span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;">'TableB'<span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;">&nbsp;</span></span></span></span></p>
<p><span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;"><span style="color: #ff0000; font-size: x-small;"></span></span></span></span>&nbsp;Please share your feedback if you find this interesting.</p>
<p>&nbsp;</p>
</p>]]></content:encoded>
    </item>
    <item>
      <title>Message "TFS10139: The following check-in policies have not been satisfied" comes in VSTS2010</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/message-tfs10139-the-following-check-in-policies-have-not-been-satisfied-comes-in-vsts2010</link>
      <pubDate>Mon, 14 Jun 2010 00:12:49 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2010/06/14/message-tfs10139-the-following-check-in-policies-have-not-been-satisfied-comes-in-vsts2010/</guid>
      <description><![CDATA[Got this message after the upgrade from VSTS 2008 to VSTS 2010 while checking in a file. The message...]]></description>
      <content:encoded><![CDATA[<p>Got this message after the upgrade from VSTS 2008 to VSTS 2010 while checking in a file. The message disappeared after installing "Team Foundation Server Power Tools April 2010" from the below location.</p>
<p><a href="https://visualstudiogallery.msdn.microsoft.com/en-us/3e8c9b68-6e39-4577-b9b7-78489b5cb1da">https://visualstudiogallery.msdn.microsoft.com/en-us/3e8c9b68-6e39-4577-b9b7-78489b5cb1da</a></p>
<p>Hope this helps :-)</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Error while enabling CDC on a table. The server principal "xyz" is not able to access the database "msdb" under the current security context.</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/error-while-enabling-cdc-on-a-table-the-server-principal-xyz-is-not-able-to-access-the-database-msdb-under-the-current-security-context</link>
      <pubDate>Wed, 12 May 2010 23:01:00 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2010/05/12/error-while-enabling-cdc-on-a-table-the-server-principal-xyz-is-not-able-to-access-the-database-msdb-under-the-current-security-context/</guid>
      <description><![CDATA[We came across the following error&nbsp;after&nbsp;successfully enabling CDC on&nbsp;a Database and...]]></description>
      <content:encoded><![CDATA[<P>We came across the following error&nbsp;after&nbsp;successfully enabling CDC on&nbsp;a Database and then trying to enable CDC on a table in SQL Server 2008 SP1 (Version 10.0.2531.0)</P>
<P><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: red; FONT-SIZE: 11pt">Msg 22832, Level 16, State 1, Procedure sp_cdc_enable_table_internal, Line 607</SPAN></P>
<P><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: red; FONT-SIZE: 11pt"></SPAN><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: red; FONT-SIZE: 11pt">Could not update the metadata that indicates table [dbo].[MyTable] is enabled for Change Data Capture. The failure occurred when executing the command '[sys].[sp_cdc_add_job] @job_type = N'capture''. The error returned was 916: <B>'The server principal "S-1-9-3-3045654011-13150378417-261222020-2009464159."</B> <B>is not able to access the database "msdb" under the current security context.'</B>. Use the action and error to determine the cause of the failure and resubmit the request.</SPAN><SPAN style="COLOR: black"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P>Since the failure message is saying the error occured while creating the Capture job, we tried explicitly creating the same using the system procedure "sp_cdc_add_job" as shown below and it solved the issue for us.</P><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&nbsp;</P>
<P>USE</FONT></FONT><FONT size=2> MyDatabase</P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>GO</P></FONT></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>
<P>--Enable CDC on the database</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>EXECUTE</FONT></FONT><FONT size=2> </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>sys</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>.</FONT></FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>sp_cdc_enable_db</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>go</P></FONT></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>
<P>--Manually create Capture job to avoid the job creation error</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>EXEC</FONT></FONT><FONT size=2> [sys]</FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>.</FONT></FONT><FONT size=2>[sp_cdc_add_job]</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> </FONT></FONT><FONT size=2>@job_type </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>N'capture'</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>go</P></FONT></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>
<P>--Enable CDC on the tables</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>EXECUTE</FONT></FONT><FONT size=2> </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>sys</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>.</FONT></FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>sp_cdc_enable_table</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> </FONT></FONT><FONT size=2>@source_schema </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>N'dbo'</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>,</FONT></FONT><FONT size=2> @source_name </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>'AdjustmentReason'</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>,</FONT></FONT><FONT size=2> @role_name </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>N'cdc_admin'</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>,</FONT></FONT><FONT size=2> @supports_net_changes </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> 1</FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>,</FONT></FONT><FONT size=2> @index_name </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>null,</FONT></FONT><FONT size=2> @captured_column_list </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>null,</FONT></FONT><FONT size=2> @filegroup_name </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>N'PRIMARY'</P></FONT></FONT>
<P mce_keep="true">---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</P>
<P mce_keep="true">If you want more details on the above error, you can refer to the&nbsp;link <A href="https://msdn.microsoft.com/en-us/library/ee342155.aspx">https://msdn.microsoft.com/en-us/library/ee342155.aspx</A>.</P>
<P mce_keep="true">Please drop me an encouraging note if this work around has helped in solving your error. Thanks in advance.&nbsp;</P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>SSIS Data Flow Task fails with Unspecified Error</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/ssis-data-flow-task-fails-with-unspecified-error</link>
      <pubDate>Tue, 05 Jan 2010 06:01:00 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2010/01/05/ssis-data-flow-task-fails-with-unspecified-error/</guid>
      <description><![CDATA[We have few SQL Agent jobs on&nbsp;SQL Server 2008 (10.0.2531) and these jobs&nbsp;are executing...]]></description>
      <content:encoded><![CDATA[<P>We have few SQL Agent jobs on&nbsp;SQL Server 2008 (10.0.2531) and these jobs&nbsp;are executing SSIS packages, which are&nbsp;created using BIDS 2008. The jobs are scheduled to run daily at a low frequency. The intention is to run these jobs like a demon service. </P>
<P>We started getting the "Unspecified Error" at random intervals of time and the jobs always failed at the Data Flow Task only.&nbsp;</P>
<P>The job's error log has the following message. However, when the error is captured using&nbsp;an event handler&nbsp;in the package, an error code of "-2147467259" is reported.&nbsp;&nbsp;</P><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P><EM>Code:</EM></FONT></FONT><FONT size=2><EM> 0x80004005 </EM></P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P><EM>Source:</EM></FONT></FONT><EM><FONT size=2> </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>&lt;</FONT></FONT><FONT size=2>Data Flow Task Name</FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>&gt;</FONT></FONT><FONT size=2> SSIS</FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>.</FONT></FONT><FONT size=2>Pipeline </P></FONT></EM><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P><EM>Description:</EM></FONT></FONT><EM><FONT size=2> Unspecified error </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> Error</P></FONT></EM><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P><EM>DTExec:</EM></FONT></FONT><EM><FONT size=2> The package execution returned DTSER_FAILURE</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> </FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>(</FONT></FONT><FONT size=2>1</FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>)</FONT></FONT></EM></P>
<P><FONT color=#808080 size=2><FONT color=#808080 size=2><FONT color=#000000>After struggling for two weeks with the error, we finally fixed it by limiting the SQL Server Memory usage. We&nbsp;restricted SQL Server&nbsp;to consume&nbsp;50% at the max. The reason for doing this is to leave enough&nbsp;memory&nbsp;to&nbsp;other services like Integration Services. Otherwise, over a period of time, SQL Server consumes almost all the&nbsp;available memory&nbsp;and releases it only when demanded by OS.</FONT></FONT></FONT></P>
<P><FONT color=#808080 size=2><FONT color=#808080 size=2><FONT color=#000000>Here is the exact script we used, which you can tweak based on the percentage you want to allocate depending on your project requirement. Let me know if this blog has helped you.</FONT></FONT></FONT></P><FONT color=#808080 size=2><FONT color=#808080 size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>DECLARE </FONT></FONT><FONT color=#000000 size=2>@TotalMemInGB </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</P>
<P>DECLARE </FONT></FONT><FONT color=#000000 size=2>@MinMemInMB </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</P>
<P>DECLARE </FONT></FONT><FONT color=#000000 size=2>@MaxMemInMB </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</P>
<P>select </FONT></FONT><FONT color=#000000 size=2>@TotalMemInGB =(physical_memory_in_bytes/(1024*1024)/1000) </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>from </FONT></FONT><FONT size=2><FONT color=#000000>sys.dm_os_sys_info</FONT></P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>SET </FONT></FONT><FONT color=#000000 size=2>@MinMemInMB= (@TotalMemInGB * 0.5) * 1024 </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>-- taking 50% of available memory.</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>SET </FONT></FONT><FONT color=#000000 size=2>@MaxMemInMB= (@TotalMemInGB * 0.5) * 1024 </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>-- taking 50% of available memory.</P>
<P mce_keep="true">&nbsp;</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>EXEC </FONT></FONT><FONT color=#000000 size=2>sp_configure </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>'show advanced options'</FONT></FONT><FONT size=2><FONT color=#000000>,1</FONT></P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>RECONFIGURE</P>
<P>EXEC </FONT></FONT><FONT color=#000000 size=2>sp_configure </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>'max server memory'</FONT></FONT><FONT size=2><FONT color=#000000>, @MaxMemInMB</FONT></P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>RECONFIGURE</P>
<P>EXEC </FONT></FONT><FONT color=#000000 size=2>sp_configure </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>'min server memory'</FONT></FONT><FONT size=2><FONT color=#000000>,@MinMemInMB</FONT></P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>RECONFIGURE </P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">&nbsp;</P></FONT></FONT></FONT></FONT>]]></content:encoded>
    </item>
    <item>
      <title>SSIS package fails with Protocol error in TDS stream</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/ssis-package-fails-with-protocol-error-in-tds-stream</link>
      <pubDate>Wed, 30 Dec 2009 05:02:00 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2009/12/30/ssis-package-fails-with-protocol-error-in-tds-stream/</guid>
      <description><![CDATA[Encountered this error while running a SSIS package through a SQL Agent Job on SQL Server 2008. The...]]></description>
      <content:encoded><![CDATA[<P>Encountered this error while running a SSIS package through a SQL Agent Job on SQL Server 2008. The processing in the package is a pretty simple and&nbsp;the purpose is to export data&nbsp;from few tables from one SQL Server to another. Both the source and target servers are on SQL Server 2008 (10.0.2531) and&nbsp;Data Flow Task&nbsp;(with OLEDB source and destination tasks) is used for data export. The package is created using Visual Studio 2008 and the job is running on the destination server. </P>
<P>The job continuously failed with the following error and in each run the failure occured at a different table.</P>
<P mce_keep="true"><FONT color=#0000ff></FONT></P>
<P style="TEXT-ALIGN: justify; LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-themecolor: text1; mso-bidi-language: HI; mso-no-proof: yes"><EM>Source: DFT_MyTable Source - MyTable <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></EM></SPAN></P>
<P style="TEXT-ALIGN: justify; LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-themecolor: text1; mso-bidi-language: HI; mso-no-proof: yes"><EM>Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. <o:p></o:p></EM></SPAN></P>
<P style="TEXT-ALIGN: justify; LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-themecolor: text1; mso-bidi-language: HI; mso-no-proof: yes"><EM>An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 </EM></SPAN></P>
<P style="TEXT-ALIGN: justify; LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-themecolor: text1; mso-bidi-language: HI; mso-no-proof: yes"></SPAN><EM><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-themecolor: text1; mso-bidi-language: HI; mso-no-proof: yes; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US">Description: "</SPAN><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: red; FONT-SIZE: 8pt; mso-bidi-language: HI; mso-no-proof: yes; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US">Protocol error in TDS stream</SPAN><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-themecolor: text1; mso-bidi-language: HI; mso-no-proof: yes; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US">". An OLE DB record is available</SPAN></EM></P>
<P>The issue is solved when the Network Protocol used to connect to the source SQL Server is changed from&nbsp;TCP/IP to NamedPipes. Basically, an alias&nbsp;for the source is created on the destination server using the below steps.</P>
<P>1. Go to Start--&gt; All Programs--&gt; Microsoft SQL Server 2008--&gt; Configuration Tools --&gt; SQL Server Configuration Manager</P>
<P>2. Expand the node SQL Native Client 10.0 Configuration</P>
<P>3. Right click on "Aliases" and then select "New Alias..."</P>
<P>4. Provide the IP address of the Source SQL server against the "Server" field and specify the Source server name against the "Alias Name" field.</P>
<P>5. Choose the protocol as "NamedPipes" and click OK</P><FONT color=#0000ff><FONT color=#0000ff>
<P style="TEXT-ALIGN: justify; LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-themecolor: text1; mso-bidi-language: HI; mso-no-proof: yes; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US"><FONT size=2>Please drop me a note if you have come across this error and this blog has helped you in resolving the issue.</FONT></SPAN></P>
<P><EM></EM></FONT></FONT>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Could not update the metadata that indicates database is enabled for Change Data Capture. The failure occurred when executing the command SetCDCTracked(Value = 1)</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/could-not-update-the-metadata-that-indicates-database-is-enabled-for-change-data-capture-the-failure-occurred-when-executing-the-command-setcdctrackedvalue-1</link>
      <pubDate>Thu, 19 Nov 2009 22:59:00 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2009/11/19/could-not-update-the-metadata-that-indicates-database-is-enabled-for-change-data-capture-the-failure-occurred-when-executing-the-command-setcdctrackedvalue-1/</guid>
      <description><![CDATA[This error message comes when you are trying to enable CDC on a SQL Server 2008 database for which...]]></description>
      <content:encoded><![CDATA[<P>This error message comes when you are trying to enable CDC on a SQL Server 2008 database for which the owner is not "sa". The exact error message will be as shown below.</P><FONT size=1>
<P>Msg 22830, Level 16, State 1, Procedure sp_cdc_enable_db_internal, Line 186</P>
<P>Could not update the metadata that indicates database&nbsp;[XXXXX] is enabled for Change Data Capture. The failure occurred when executing the command 'SetCDCTracked(Value = 1)'. The error returned was 15404: 'Could not obtain information about Windows NT group/user 'Domain\user', error code 0x5.'. Use the action and error to determine the cause of the failure and resubmit the request.</P>
<P>Msg 266, Level 16, State 2, Procedure sp_cdc_enable_db_internal, Line 0</P>
<P>Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 2.</P>
<P>Msg 266, Level 16, State 2, Procedure sp_cdc_enable_db, Line 0</P>
<P>Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 2.</P>
<P></FONT>The fix for this is to change the databse owner to "sa"&nbsp;by executing the below script.</P><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>USE</FONT></FONT><FONT size=2> </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>&lt;</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Database</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>&gt;</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>GO</P>
<P>EXEC</FONT></FONT><FONT size=2> </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>sp_changedbowner</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> </FONT></FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>'sa'</P></FONT></FONT>
<P mce_keep="true">Read the below KB article for more details.</P>
<P mce_keep="true"><A href="https://support.microsoft.com/kb/913423" mce_href="https://support.microsoft.com/kb/913423">https://support.microsoft.com/kb/913423</A></P>]]></content:encoded>
    </item>
    <item>
      <title>Explicit value must be specified for identity column in table [XXXXXX] either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/explicit-value-must-be-specified-for-identity-column-in-table-xxxxxx-either-when-identity_insert-is-set-to-on-or-when-a-replication-user-is-inserting-into-a-not-for-replication-identity-column</link>
      <pubDate>Fri, 13 Nov 2009 01:37:00 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2009/11/13/explicit-value-must-be-specified-for-identity-column-in-table-xxxxxx-either-when-identity_insert-is-set-to-on-or-when-a-replication-user-is-inserting-into-a-not-for-replication-identity-column/</guid>
      <description><![CDATA[I encountered this error when explicitly inserting values in an Identity column of a Table that is...]]></description>
      <content:encoded><![CDATA[<P>I encountered this error when explicitly inserting values in an Identity column of a Table that is created in a&nbsp;SQL Server 2008 Database and the DB is not part of any kind of Replication. I have made sure that&nbsp;"Identity_Insert" is turned on for that table before performing the insert. Also I have checked that "NOT FOR REPLICATION" is disabled for that&nbsp;Identity column (Obviously, it is in disabled state in my case&nbsp;as there is no Replication). </P>
<P>After struggling for some time, I noticed that&nbsp;an "Instead of Insert"&nbsp;Trigger exist on the Table. The interesting thing is, no change is happening to the Idenity column in the Trigger definition. However,&nbsp;disabling that Trigger&nbsp;fixed the issue miraculously :-) </P>
<P>Let me know if this&nbsp;fix has helped you too.&nbsp;</P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Failed to open package file due to error 0x80070020. The process cannot access the file because it is being used by another process. This happens when loading a package and the file cannot be opened or loaded correctly into the XML document.</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/failed-to-open-package-file-due-to-error-0x80070020-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process-this-happens-when-loading-a-package-and-the-file-cannot-be-opened-o</link>
      <pubDate>Fri, 28 Aug 2009 11:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2009/08/28/failed-to-open-package-file-due-to-error-0x80070020-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process-this-happens-when-loading-a-package-and-the-file-cannot-be-opened-o/</guid>
      <description><![CDATA[This error message comes while performing one (Or both) of the following actions.
1.&nbsp;Run SSIS...]]></description>
      <content:encoded><![CDATA[<P>This error message comes while performing one (Or both) of the following actions.</P>
<P>1.&nbsp;Run SSIS Package using dtexec.exe (Either from a command file or&nbsp;through a Job running on SQL Server 2008)</P>
<P>2. Open SSIS package using&nbsp;VS2008 or BIDS</P>
<P>If you have a log file for the job, the exact error essage<EM>&nbsp;</EM>you see would be as follows<EM>:</EM></P>
<P><EM>-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</EM></P>
<P><EM>Microsoft (R) SQL Server Execute Package Utility<BR>Version 10.0.1600.22 for 32-bit<BR>Copyright (C) Microsoft Corp 1984-2005. All rights reserved.</EM></P>
<P><EM>Error:&nbsp;<BR>&nbsp;&nbsp; Code: 0xC0011007<BR>&nbsp;&nbsp; Source: {95765D16-E9AA-4DDA-9932-9DF1281E1208} <BR>&nbsp;&nbsp; Description: Unable to load the package as XML because of package does not have a valid XML format. A specific XML parser error will be posted.<BR>End Error<BR>Error:&nbsp;<BR>&nbsp;&nbsp; Code: 0xC0011002<BR>&nbsp;&nbsp; Source: {95765D16-E9AA-4DDA-9932-9DF1281E1208} <BR>&nbsp;&nbsp; Description: Failed to open package file "E:\MyPackage.dtsx" due to error 0x80070020 "The process cannot access the file because it is being used by another process.".&nbsp; This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.<BR>End Error<BR>Could not load package "E:\MyPackage.dtsx" because of error 0xC0011002.<BR>Description: Failed to open package file "E:\MyPackage.dtsx" due to error 0x80070020 "The process cannot access the file because it is being used by another process.".&nbsp; This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.<BR></EM>Source: {95765D16-E9AA-4DDA-9932-9DF1281E1208}</P>
<P><BR><EM>-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</EM></P>
<P><STRONG>Fix:</STRONG>&nbsp;The fix is&nbsp;same as the one I explained in my other <A title="Package migration from version 3 to version 2 failed with error 0xC001700A. The version number in the package is not valid. The version number cannot be greater than current version number" href="https://blogs.msdn.com/ramoji/archive/2008/12/24/package-migration-from-version-3-to-version-2-failed-with-error-0xc001700a-the-version-number-in-the-package-is-not-valid-the-version-number-cannot-be-greater-than-current-version-number.aspx" mce_href="https://blogs.msdn.com/ramoji/archive/2008/12/24/package-migration-from-version-3-to-version-2-failed-with-error-0xc001700a-the-version-number-in-the-package-is-not-valid-the-version-number-cannot-be-greater-than-current-version-number.aspx"><STRONG>blog</STRONG></A>. The physical path&nbsp;of SQL Server 2008's DTEXEC.exe should appear first in the PATH environment variable.</P>
<P><STRONG></STRONG>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Checkin cannot proceed because the policy requirements have not been satisfied.</title>
      <link>https://docs.microsoft.com/archive/blogs/ramoji/checkin-cannot-proceed-because-the-policy-requirements-have-not-been-satisfied</link>
      <pubDate>Wed, 26 Aug 2009 09:45:00 GMT</pubDate>
      <dc:creator><![CDATA[Ramoji]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ramoji/2009/08/26/checkin-cannot-proceed-because-the-policy-requirements-have-not-been-satisfied/</guid>
      <description><![CDATA[I got this message while checking-in a file&nbsp;after the fresh installation of&nbsp;Visual Studio...]]></description>
      <content:encoded><![CDATA[<P>I got this message while checking-in a file&nbsp;after the fresh installation of&nbsp;Visual Studio 2008 Professional and&nbsp;TFS client.</P>
<P>This message disappeared&nbsp;after installing VSTS 2008 Power Tools. The download link is provided for your quick reference here.&nbsp;</P>
<P><A href="https://www.microsoft.com/downloads/details.aspx?FamilyId=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0&amp;displaylang=en" mce_href="https://www.microsoft.com/downloads/details.aspx?FamilyId=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0&amp;displaylang=en">https://www.microsoft.com/downloads/details.aspx?FamilyId=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0&amp;displaylang=en</A></P>
<P>Please share your feedback if the same fix has helped you.</P>]]></content:encoded>
    </item>
  </channel>
</rss>