tag:blogger.com,1999:blog-5098208425613902582.post4000901642359865381..comments2023-05-24T04:03:44.929-07:00Comments on Tips and Tricks for SQL Server Developers: Dynamic SSIS Package to Import Excel files into SQL Server DatabaseSQL BI Devhttp://www.blogger.com/profile/05174359128365572180noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-5098208425613902582.post-83452454863136497222013-07-15T01:00:01.889-07:002013-07-15T01:00:01.889-07:00i got this error :
[Execute SQL Task] Error: An er...i got this error :<br />[Execute SQL Task] Error: An error occurred while assigning a value to variable "LastRunDate": "The type of the value being assigned to variable "User::LastRunDate" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.<br />".<br /><br />in my package variable LastRunDate is string....Narendra Duttahttps://www.blogger.com/profile/07361159000911612375noreply@blogger.comtag:blogger.com,1999:blog-5098208425613902582.post-7542122451118219312013-03-20T02:37:49.180-07:002013-03-20T02:37:49.180-07:00Please provide the all steps will be appreciated.Please provide the all steps will be appreciated.Satish Kumarhttp://www.blogger.com/profile/17599887793708850219noreply@blogger.comtag:blogger.com,1999:blog-5098208425613902582.post-16586452827494611152012-10-05T16:15:53.408-07:002012-10-05T16:15:53.408-07:00Thanks ZeeAay for the great feedback. Albeit, I wo...Thanks ZeeAay for the great feedback. Albeit, I would appreciate if you mention "MANY MANY step" which are missing...<br><br>I wrote this article couple of years back by following actual code I wrote for some real project. I tried to include all the steps I could remember but it would be great if you can mention what steps are actually missing.Hari Sharmahttp://www.blogger.com/profile/17519330349426599363noreply@blogger.comtag:blogger.com,1999:blog-5098208425613902582.post-56372532028684455422012-10-05T09:00:41.020-07:002012-10-05T09:00:41.020-07:00it is an old but no doubt it is quite usefull to l...it is an old but no doubt it is quite usefull to learn SSIS but unfortunately it is missing many many steps, and without those one could get easily lost and purpose of education dies. <br><br>I wish you could have explained in segments and without skipping some fundamental tasks.<br><br>You efforts are appreciated very highly but efforts without a fruitful results is not goodZeeAaYhttp://www.blogger.com/profile/17604150656650182003noreply@blogger.comtag:blogger.com,1999:blog-5098208425613902582.post-19226422047430518912010-10-19T23:14:39.158-07:002010-10-19T23:14:39.158-07:00Hi Ronaldomar,Error1: Did you set variable Directo...Hi Ronaldomar,<br>Error1: Did you set variable DirectoryDestination with default value? In my exapmle it is "D:\SSIS\Hari\DestinationFiles". However you can configure this value through package configuration.<br><br>Error2: It seems that you haven't properly configured your connection Manger which is used for OLE DB Destination.Hari Sharmahttp://www.blogger.com/profile/17519330349426599363noreply@blogger.comtag:blogger.com,1999:blog-5098208425613902582.post-10065903993838631922010-10-15T08:37:56.789-07:002010-10-15T08:37:56.789-07:00Thank you for your article. It is really interstin...Thank you for your article. It is really intersting. Unfortunately if you are a NewB there are couple Steps that aren't detailed. I am getting the following error when tryied to folow your steps project step by step. could you help please?<br><br>Error 1 Validation error. FST - Delete destination directory content File System Task: Variable "DirectoryDestination" is used as a source or destination and is empty. <br>Error 2 Validation error. Data Flow Task OLE DB Destination [26]: A connection manager has not been assigned to the runtime connection "OleDbConnection" (34).ronaldomarhttp://www.blogger.com/profile/12210224936544842717noreply@blogger.comtag:blogger.com,1999:blog-5098208425613902582.post-81413018612053620772010-09-29T07:12:35.448-07:002010-09-29T07:12:35.448-07:00Hey i have tried the process ,on executing the scr...Hey i have tried the process ,on executing the script task "load excel sheet to table " I have been receiving the status as Failure. Please find the code below :<br>Public Class ScriptMain<br><br><br> Enum ScriptResults<br> Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success<br> Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure<br> End Enum<br><br> Public Sub Main()<br> '<br> ' Add your code here<br> '<br> ' Dts.TaskResult = Dts.Results.Success<br><br><br> Try<br> Dim DirectorySource As String<br> Dim DirectoryDestination As String<br> 'Dim ScriptResults As ScriptTask<br><br><br> DirectorySource = Dts.Variables("User::DirectorySource").Value.ToString()<br> DirectoryDestination = Dts.Variables("User::DirectoryDestination").Value.ToString()<br> Dim LastRunDate As DateTime = CType(Dts.Variables("User::LastRunDate").Value, DateTime)<br><br><br> Dim fileName As String, fileExtension As String<br> Dim files() As String = Directory.GetFiles(DirectorySource)<br> 'Copy source files to destination<br> Dim CurrentDate As Date<br><br> Dim f As String<br> For Each f In files<br><br> fileName = Path.GetFileName(f)<br> fileExtension = Path.GetExtension(f)<br><br> CurrentDate = DateTime.Parse(fileName.Substring("Transaction".Length, 10))<br><br><br> If (DateTime.Compare(CurrentDate, LastRunDate) > 0) Then<br> 'MessageBox.Show(fileName.ToString());<br> File.Copy(f, Path.Combine(DirectoryDestination, fileName), True)<br> End If<br> Next<br><br> Dts.TaskResult = CType(ScriptResults.Success, Integer)<br><br> Catch ex As Exception<br> Dts.Log(ex.Message, 0, Nothing)<br> Dts.TaskResult = CType(ScriptResults.Failure, Integer)<br> End Try<br><br> End Sub<br><br>End ClassChaituhttp://www.blogger.com/profile/15379264946312403968noreply@blogger.com