Quantcast
Channel: SQL Server Integration Services forum
Viewing all 24688 articles
Browse latest View live

SSIS OnPostExecute event is executing multiple times (Execute Package Task)

$
0
0
Hi,

I have a simple 2008 SSIS package that has only one Execute Package Task.
What I am trying to do is send a mail on - OnPostExecute event on this Execute .

The OnPostExecute event is firing successfully but multiple times.
I believe OnPostExecute should fire only one time.

Is their any way to limit the PostExecuteEvent from firing multiple times?


Thanks

Apne


Deploying SQL Server 2012 SSIS packages in SQL Server 2008 R2

$
0
0
We had developed SSIS packages in SQL Server 2012 environment.  But due to some reason we need to deploy these packages in SQL Server 2008 R2 environment.  Does SQL Server supports forward compatibility for SSIS packages?

having troubles deploying SSIS packages to a named instance for SQL 2005

$
0
0

Hello,

I have  a user that is having trouble deploying a SSIS package to a named instance in SQL 2005.  After he deploys it, he doesn't see the package when he logs into SQL 2005

I added the named instance in the XML and restarted the sql service but to no effect.  Also, I am unable to find a guide/walkthrough on what to do when deploying SSIS packages to a named instance.

Comments would be greatly appreciated.

Thanks,

SSIS Script Task calling batch file does not return to run the next task in a Package

$
0
0

Hello!

I have a series of Tasks running in an SSIS Package. Everything runs perfectly in debug mode, however when I run without debug it hangs after a Script Task when I am calling a batch file (as if it doesn't return). Here is my code. I am almost close to deploying this if I can get it to work. The batch files runs fine but doesn't return to run the next Task.  Thanks! Mike

   public void Main()
        {
            Program myProcess = new Program();

            myProcess.OpenWithArguments();

        }
        class Program
        {

            // TODO: Add your code here
            public void OpenWithArguments()
            {

                string command = @"C:\p260Batch\frodobattest.bat";
                ProcessStartInfo startInfo = new ProcessStartInfo("CMD.exe", "/k " + command)
        
                Process p = new Process();

                startInfo.RedirectStandardInput = true;

                startInfo.UseShellExecute = false; //changed from false on 5/6
                startInfo.Verb = "runas";

                startInfo.RedirectStandardOutput = true;

                startInfo.RedirectStandardError = true;

                p = Process.Start(startInfo);

                p.WaitForExit();

                p.StandardInput.WriteLine(@"EXIT");

                p.StandardInput.Close();

                p.WaitForExit();

                p.Close();

                Console.Read();


            }


Mike Kiser

Ole DB Command calling a store procedure with a GUID parameter (Error Converting String to Uniqueidentifier)

$
0
0

Hi,

I hope someone can help me on this, Ive been struggling for days and read a lot of forums.

I created a String Variable to use in a for each loop component and Derived Column to transform it first into (DT_STR,36,1252)@[User::ID_Provider] and then a second Derived Column to transform it to (DT_GUID)provider_id  with the value in the format I want I send it to an OLE DB Command to call to a store procedure. 

The store procedure receives the parameter as a varchar(36) (on the oledb command the @ external columns are declared as DT_STR.  On the Input Column the column is declared as DT_GUID (last derived column).   Inside the store procedure the varchar 36 parameter inserts into a table that has a uniqueidentifier column. 

When I run my package this is the error I get.  Ive tried a lot of thing but nothing seems to work.  Do you have an idea of what can I do to success on this task?

"Conversion failed when converting from a character string to uniqueidentifier.".

Thank you in advance !!!

Regards

Adriana

All, what is the best SSIS Performance Monitor tool ?? I been gooling for a while ... thanks ...

$
0
0
All, what is the best SSIS Performance Monitor tool ?? I been gooling for a while ... thanks ...

Incremental Load in Via CDC tables

$
0
0

Hi ,

I am using SQL Server 2008 SSIS and SQL Server 2008 CDC features.

my Source system will be a different machine.

I do have seen lot of blogs and codplex package for CDC incremental load.

I saw example from MSDN site as well.

http://msdn.microsoft.com/en-us/library/bb895315(v=sql.100).aspx

but if understand correctly that using LSN number of CDC database for detecting changes is not relaible.  i am facing same challange.

See this post

http://www.sqltact.com/2010/08/cdc-dbofnallchanges-frustrating.html

I am facing same problem, it is not necessary that maximum and Min LSN number from CDC database can be pass on to cdc.fn_cdc_get_all_changes_. it will throw an error.

also wehn you have mutiple tables to load it may be possible some of the tables have not captured any data as there was no change. so getting min and max LSN number from every table is again not a solution.

What i would like to understand that what is way to reduce complexity of ETL and make this loading smother and faster.

Else we have to create configuration table for having MAX-MIN LSN number for every table and also need to have conditional execution in SSIS to ensure those MAX and MIN LSN are not null and if NULL then dont pull data from Source.

Please suggest?? if there are any better way...

samples


Gaurav Gupta http://sqlservermsbiblog.blogspot.com/ Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.

Straight load- Giving error

$
0
0

Hello,

I m just loading a file into a sql table, and it is just straight load. Please can anyone tell me why is this error occuring.


From Excel to SQL Server Database getting errors!

$
0
0

Getting the following error from SSIS when trying to take an Excel file and import it into a SQL database.  I have two other Excel files in the same location that get brought in just fine, it's just this one excel.  I've tried doing a data conversion within SSIS that doesn't work, I've tried changing the data type in the Excel file, nothing seems to work.

Error Message:

[ReviewDetails Table [54]] Error: An error occurred while setting up a binding for the "Review_Notes" column. The binding status was "DT_NTEXT". The data flow column type is "DBBINDSTATUS_UNSUPPORTEDCONVERSION". The conversion from the OLE DB type of "DBTYPE_IUNKNOWN" to the destination column type of "DBTYPE_WVARCHAR" might not be supported by this provider.

Thanks,
Schlieper


This posting is provided "AS IS" with no warranties, and confers no rights.

Processing csv with multiple repeating columns

$
0
0

Hi all,

I have a csv file, which repeats in the column as follows

col1, col2, col3, col4 ^ col1, col2, col3, col4 ^ col1,col2,col3,col4

'^' is the separator 

How can I process this under SSIS making col1 to col4 reach table1 with 3 rows.

Thanks
Pad

Process only the first line

$
0
0

Hi,

While processing a csv file, would it be possible to break execution after reading the first line alone. I have created a script component and reading the first line, but the problem, it reads the next line as well. How can I stop this?

Thanks,

Pad

Calling SOAP request in webservice from Script task in SSIS

$
0
0

Hi all,

I hope someone can help me with my challenge..

I'm new to SSIS and have some troubles with webservices, which I can't seem to solve yet.

I'm using Visual Studio 2010 Shell.

I have an (external) webservice which should give me back a XML file with results (and or a PDF file).

I have the correct url with a WSDL.

I tried to use to Webservice task in SSIS, but I got the error "The selected web method contains unsupported arguments". After some searching I found an alternative in using a Script task.

Unfortunaly I can't get it to work.
I get the following error:

"Exception has been thrown by the target of an invocation

   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()"

My Visual Basic script 2010 looks like this:

"

#Region "Help:  Introduction to the script task"
'The Script Task allows you to perform virtually any operation that can be accomplished in
'a .Net application within the context of an Integration Services control flow. 

'Expand the other regions which have "Help" prefixes for examples of specific ways to use
'Integration Services features within this script task.
#End Region


#Region "Imports"
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime

Imports System.Net
Imports System.IO
Imports System.Text
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization
Imports System.Xml


#End Region

'ScriptMain is the entry point class of the script.  Do not change the name, attributes,
'or parent of this class.
<Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute()> _<System.CLSCompliantAttribute(False)> _
Partial Public Class ScriptMain
    Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase


#Region "Help:  Using Integration Services variables and parameters in a script"
    'To use a variable in this script, first ensure that the variable has been added to 
    'either the list contained in the ReadOnlyVariables property or the list contained in 
    'the ReadWriteVariables property of this script task, according to whether or not your
    'code needs to write to the variable.  To add the variable, save this script, close this instance of
    'Visual Studio, and update the ReadOnlyVariables and 
    'ReadWriteVariables properties in the Script Transformation Editor window.
    'To use a parameter in this script, follow the same steps. Parameters are always read-only.

    'Example of reading from a variable:
    ' startTime = Dts.Variables("System::StartTime").Value

    'Example of writing to a variable:
    ' Dts.Variables("User::myStringVariable").Value = "new value"

    'Example of reading from a package parameter:
    ' batchId = Dts.Variables("$Package::batchId").Value

    'Example of reading from a project parameter:
    ' batchId = Dts.Variables("$Project::batchId").Value

    'Example of reading from a sensitive project parameter:
    ' batchId = Dts.Variables("$Project::batchId").GetSensitiveValue()
#End Region

#Region "Help:  Firing Integration Services events from a script"
    'This script task can fire events for logging purposes.

    'Example of firing an error event:
    ' Dts.Events.FireError(18, "Process Values", "Bad value", "", 0)

    'Example of firing an information event:
    ' Dts.Events.FireInformation(3, "Process Values", "Processing has started", "", 0, fireAgain)

    'Example of firing a warning event:
    ' Dts.Events.FireWarning(14, "Process Values", "No values received for input", "", 0)
#End Region

#Region "Help:  Using Integration Services connection managers in a script"
    'Some types of connection managers can be used in this script task.  See the topic 
    '"Working with Connection Managers Programatically" for details.

    'Example of using an ADO.Net connection manager:
    ' Dim rawConnection As Object = Dts.Connections("Sales DB").AcquireConnection(Dts.Transaction)
    ' Dim myADONETConnection As SqlConnection = CType(rawConnection, SqlConnection)
    ' <Use the connection in some code here, then release the connection>
    ' Dts.Connections("Sales DB").ReleaseConnection(rawConnection)

    'Example of using a File connection manager
    ' Dim rawConnection As Object = Dts.Connections("Prices.zip").AcquireConnection(Dts.Transaction)
    ' Dim filePath As String = CType(rawConnection, String)
    ' <Use the connection in some code here, then release the connection>
    ' Dts.Connections("Prices.zip").ReleaseConnection(rawConnection)
#End Region

    'This method is called when this script task executes in the control flow.
    'Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
    'To open Help, press F1.

    Public Sub Main()

        Dim Request As String = ""
        Dim gebruiker As String = "xx"
        Dim wachtwoord As String = "xx"
        Dim plaats As String = "xx"
        Dim bedrijf As String = "xx"
        Dim rechtsvorm As String = "xx"
        Dim sYear As String = "2012"
        Dim KVKnummer As String = ""
        Dim sbi As String = "xx"
        Dim sString As String = "xx"
        Dim Format As String = "FinanXML"
        Dim benchmarkID As String = "470"
        Dim scale As String = "1"
        Dim delivery As String = "false"

        Request = Request & "<?xml version='1.0' encoding='utf-8'?>"
        Request = Request & "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ben='http://benchmark.webservice.finconnect.finan.nl/'>"
        Request = Request & "<soapenv:Header/>"
        Request = Request & "<soapenv:Body>"
        Request = Request & "<ben:findActiveBenchmarks>"
        Request = Request & "<year>" & sYear & "</year>"
        Request = Request & "<sbi>" & sbi & "</sbi>"
        Request = Request & "</ben:findActiveBenchmarks>"
        Request = Request & "</soapenv:Body>"
        Request = Request & "</soapenv:Envelope>"


        'Create xmlhttp object 
        Dim xmlhttp As Object = CreateObject("Microsoft.XMLHTTP")
        Call xmlhttp.open("POST", "https://benchmarkplatform.sra.nl/finconnect/benchmark", False)
        Call xmlhttp.setRequestHeader("Content-Type", "text/xml")
        Call xmlhttp.setRequestHeader("SOAPAction", "")
        Call xmlhttp.send(Request)


        Call MsgBox(xmlhttp.responsetext)

        Dim resultaat As String
        resultaat = xmlhttp.responseText
        resultaat = Replace(resultaat, "&gt;", ">")
        resultaat = Replace(resultaat, "&lt;", "<")
        resultaat = Replace(resultaat, "&quot;", """")

        Call MsgBox(resultaat)

        Dts.TaskResult = ScriptResults.Success

    End Sub

#Region "ScriptResults declaration"
    'This enum provides a convenient shorthand within the scope of this class for setting the
    'result of the script.

    'This code was generated automatically.
    Enum ScriptResults
        Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
        Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    End Enum

#End Region

End Class

Can some one help me? What am I doing wrong?

FYI: I already added a Service reference tot de WSDL in the script project.




Export data from SQL DB to CSV

$
0
0

Hi,

I wish to export data from SQL server db to CSV. My Table has 78 columns and some columns has a comma in between characters. When I export it to csv, the output get displaced. Is there any way to overcome this issue when I export 78 columns to a csv file? 

I am trying to avoid using replace for each column if possible before exporting.

Thank you

Export data from SQL DB to Excel (Script Task / C#)

$
0
0

Hi,

I am trying to export data to excel from a sql table. There are 263* columns. 

I have created an excel workbook and saved column headers in first row of the excel workbook.

Created Excel connected and pointed to that .xlsx file with Excel 2007 selected.

Dragged excel destination.


BUT not all columns are showing in the mapping tab. Is there a column limit ('07 has huge column limit as far as I know).

Is there a way to use C#/Script Task/Component to export data to excel sheet?

Thank you


Specific Format to Flat File Destination

$
0
0

Hi,

Im new to formatting flat files destinations, any help is really appreciated.

I have a for each loop container that creates one flat file per certain filters so each iteration would have only one record. 

What I want to accomplish is to switch the column names or headers to be in the rows and then start showing the value of that column all this as a Flat File. 

Something like this:

FROM THIS:

Col 1     Col 2     Col 3    Col 4

   a          b            c         d

TO THIS:

Col 1:   a

Col2:    b

Col3:    c

Col4:    d

Can this type of formatting can be accomplished?

Thank you guys !

Regards,

Adriana


Setting (DT_STR, «length», «code_page»)

$
0
0

Hello!

I cannot get Derived Column Transform to parse the (DT_STR, «length», «code_page») data type for me. I dare to say I understand the length but the <page>, I don't understand that. I'd appreciate your help or clarification on this. Below is an example of how I set it up

(DT_STR, 1, 265) [FlightCode]

What is wrong with that even though I don't understand what page code 265 is

Thank you


Zionlite


Change data type in the Flat File Connection Manager Editor

$
0
0

Hi,

I have a set of .CSV files and I am using Flat File connection manager.

Is it correct to use the Flat file Connection Manager editor to change the Name, DataType and OutputColumnWidth?

Or should I use the 
1) Flat File source task to change the name
2) Data Conversion Task to perform the Data type change
3) where to change the column width in that case?

Please help

Thanks,
Swamy

Multiple SSIS Packages need Access table to "compact and repair"

$
0
0

I am moving multple SSIS packages over to a new server, most of them write out to an Access Database. All of the packafes currently have a script task to 'compact and repair' but I am looking for a way to compact and and repair all databases on the server in one step.

I was wondering if there is way to automate this process without too much scripting, or if there is a simpler method than the script task?

If I go into Access setting and set 'compact on close' will that do the same as the compact and repair script task when the package runs?

Microsoft Visual Studio is unable to load this document

$
0
0

I have VS 2010 Professional on my machine. SQL Server 2012 components are also installed. When i try to open a SSIS package i get an error as "Microsoft Visual Studio is unable to load this document. Reinstall SSDT.". I did reinstall SSDT tools and it did not work.

ANy idea how i can resolve this issue.

Thanks


How to trouble shoot the Sql Server Job failure

$
0
0

Hello ,


I am getting below error at time executing sql server job.

In Executing "C:\Program Files (x86)\ABS.exe" "" at "", The process exit code was "-532459699" while the expected was "0". End Error  DTExec: The package execution returned DTSER_FAILURE (1)

In package i am executing one .exe file to pull some information from web service.

Can you help on this....

Regards,


Vaishu



Viewing all 24688 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>