John Stagich's Blog

Microsoft .Net Developer

SSIS package does not run when you call the SSIS package from a SQL Server Agent job step

clock February 16, 2010 03:46 by author johnstagich

I created a simple SSIS package to copy a table from one database to another.   The source and destination connections used SQL Server authentication.  

When I tried to run the package in an SQL Agent job I received an error message:  [DTS.Pipeline] Error: component "Source - History" (1) failed validation and returned error code 0xC020801C. 

Here was the fix for me.  When I imported the SSIS package to Integration Services, I set the Package Protection Level to “Rely on server storage and roles for access control.”

 

 

These links helped in solving the problem: 
 

http://support.microsoft.com/kb/918760
http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.dtsprotectionlevel.aspx
http://www.codeproject.com/KB/aspnet/Schedule__Run__SSIS__DTS.aspx

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Bulk Insert Error with UNC Path: Message 4860

clock February 2, 2010 05:36 by author johnstagich

I tried executing the following Bulk Insert command, having UNC paths, from SQL Server Management Studio running on my laptop and connected to the appropriate database.  I connected using Windows Authentication.

BULK INSERT dbo.Load_itemDetail
FROM '\\server1\Outbound\orditem.txt'
WITH (FORMATFILE = '\\server1\Outbound\FormatFiles\ORDITEMNEW.FMT')

I then received the following error message:

Msg 4860, Level 16, State 1, Line 2 Cannot bulk load. The file "\\server1\Outbound\orditem.txt" does not exist.

When I had our administrator run the bulk insert command from within SQL Server Management Studio running on the same machine as the SQL Server instance, the command worked.

Fix: When running SQL Server Management Studio from a machine other than the machine where the SQL Server instance resides, you need to connect to the server where the database resides using SQL Server authentication.  The SQL Server login account that you use to connect must also have the "bulkadmin" server role assigned to it.  After logging in with SQL Server authentication, I was able to execute the Bulk Insert command without error.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


November 2009 Quick Hits

clock November 17, 2009 07:06 by author johnstagich

 

  • I was working with an .csv (comma separated variable) file in Excel.  When saving the document, a column that had numeric data, had the leading zero truncated.  That is, the data was entered as 05, but was saved with only the 5.  The reason for this is because Excel sees that data as numeric, and treats it as such, even though I wanted it to be treated as a text field.   The solution to this problem is to format the cells in the column with a Custom Format.  Highlight the column, and press Ctrl+1.  The Format Cells dialog box appears.  In the Number tab, underneath Category:, select Custom.  In the Type: box, enter 00 (or however many digits you would like to keep).  Save the file.

  • Here is a good T-SQL link for formatting dates: http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


April 2009 Quick Hits

clock April 13, 2009 06:17 by author johnstagich
  • SQL 2008 "Features"
While making minor modifications to a table, I would get an error when I tried to save.  To fix, go to Tools->Options->Designers->Table and Database Designers and uncheck the Prevent saving chages that require table re-creation in the Tabel Options Group Box.

IntelliSense cache needs to be manually updated after modifying tables. I discovered this "feature" after adding a rowguid column to a table.  I then tried to run an automated "Select All Rows" query, and intellisense errors apppeared in the query.  I was able to run the query successfully however.  The problem was that the IntelliSense cache needed to be updated.  It did not have the information about the new rowguid column.  To update Intellisense Cache, go to Edit->IntelliSense->Refresh Local Cache (Ctnl+Shift+R).  For more information, check out this link: http://blog.sqlauthority.com/2009/03/31/sql-server-2008-intellisense-does-not-work-enable-intellisense/


  • Here is a link to a to a three part series of articles from Bill Ramos on degugging T-SQL in Microsoft SQL Server 2008.

  • From tip number 56 Tips & Tricks for ASP.NET, IIS, and Visual Web Developer:

    1) From the keyboard: Ctrl+Shift+J will do it.  Wait for "Updating Intellisense..." message on status bar, then try invoking Intellisense again.
    2) From the menu: Select Edit menu, then Intellisense->Update Java Script Intelllisense.  Again, wait for "Updating Intellisense..." message on status bar, then invoke Intellisense. 

  • Want to Learn about PowerShell?  Here is a link to Idera's Practical PowerShell Video Series.

  • From Scott Mitchell's blog, a series of tutorials on ASP.Net Hosting.  http://www.asp.net/learn/hosting/

  • Here is a query to get a row count from each table in your database:

--Get all table names

BEGIN

Select Name into #tableNames from sysobjects where xtype = 'U' order by 1

Create Table #TableCount (TableName Varchar(100), NoOfRowCount bigint)

declare @name varchar(100)

--declare a cursor to loop through all tables

declare cur cursor for select * from #tableNames

open cur

fetch next from cur into @name while @@fetch_status=0

begin

Insert #TableCount

exec ('select ''' + @name + ''' , count(1) from ' + @name)

print 'Fetching count of table : ' + @name

fetch next from cur into @name

end

close cur

deallocate cur

--show the data

Select * from #TableCount drop table #tableNames

drop table #TableCount

END

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Search

Calendar

<<  March 2010  >>
SuMoTuWeThFrSa
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Archive

Tags

Categories


Blogroll

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in