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

DataFlow task hangs after PreExecute method is finished inside ScriptComponent (ProcessInput method never hits breakpoint)

$
0
0

i have a DataFlow task with FlatFile source (5 cols, 10k rows approx with 1 incomplete row at the end) > OleDb destination and ScriptComponent error output destination...

i have put a breakpoint inside the PreExecute() method and to the ProcessInput method of the script component...

when i run the package (F5) th PreExecute() method breakpoint is hit, then when i step to the next it hangs - no error within 10 minutesof waiting and the breakpoint in ProcessInput method is never hit....

any suggestion for diagnostics?


SSIS message instantly upon running "There were build errors" leading to Error "being used by another process."

$
0
0
  1. SSIS package importing multiple unique excel spreadsheets that has run successfully multiple times.
  2. Suddenly, receive message instantly upon hitting Start "There were build errors etc...continue running"
  3. Full Error message "Failed to load the package "Exception deserializing the package "The process cannot access the file 'C:\Users\Trader\Documents\Kavi Capital\Cockpit\SQL\SSIS Work\ESMonthlyTS\ESMonthlyTS\bin\Development\TrueStrength.ispac' because it is being used by another process.".".


It's time for the TechNet Wiki SSIS "Great Guru Love-in"! You too can get some loving!

$
0
0

February at TechNet Wiki usually involves a lot of love...

 

We love to read.

We love to learn.

We love our gurus, for they love to give.

 

Computer Geek Love Story Stock Photos

 

We love to make friends and promote great content.

We love to meet the community, and get closer to you.

  

 

We love to interview our winners, and bestow much love and honor upon them.

We love to tell the world of your achievements, and we promote those most active to inner circles!

All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something you had to solve for your own day's work today.

Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

HOW TO WIN

1) Please copy over your Microsoft technical solutions and revelations toTechNet Wiki.

2) Add a link to it on THIS WIKI COMPETITION PAGE (so we know you've contributed)

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

If you win, we will sing your praises in blogs and forums, similar to the weekly contributor awards. Once "on our radar" and making your mark, you will probably be interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!

Winning this award in your favoured technology will help us learn the active members in each community.

Feel free to ask any questions below.

More about TechNet Guru Awards

Thanks in advance!
Pete Laker


#PEJL
Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over toTechNet Wiki, for future generations to benefit from! You'll never get archived again, and you could win weekly awards!

Have you got what it takes o become this month's TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!



#PEJL
Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over toTechNet Wiki, for future generations to benefit from! You'll never get archived again, and you could win weekly awards!

Have you got what it takes o become this month's TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!

Compute MD5 hash value using script component

$
0
0

Hi ,

I am looking to convert all the source column to md5 hash value,

I never worked on this scenario.below is my code , please suggest me where and what i need to change in code to get md5 value in derived columnhashvalue of all incoming rows.

My script component code is :-

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Data.SqlClient
Imports System.Data.SqlClient.SqlConnection
Imports Microsoft.SqlServer.Dts.Pipeline
Imports System.Text
Imports System.Security.Cryptography

<Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute()> _
<CLSCompliant(False)> _
Public Class ScriptMain
    Inherits UserComponent
    Dim connMgr As IDTSConnectionManager100
    Dim sqlConn As SqlConnection
    Dim sqlCmd As SqlCommand
    Dim sqlParam As SqlParameter
    Private inputBuffer As PipelineBuffer
    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
        connMgr = Me.Connections.Connection
        sqlConn = CType(connMgr.AcquireConnection(Nothing), SqlConnection)
    End Sub

    Public Overrides Sub PreExecute()
        sqlCmd = New SqlCommand("SELECT * FROM TestEmpS", sqlConn)
        'sqlParam = New SqlParameter("@filem", SqlDbType.VarChar)
        'sqlCmd.Parameters.Add(sqlParam)
    End Sub

    Public Overrides Sub CustomerRecordsInput_ProcessInputRow(ByVal Row As CustomerRecordsInputBuffer)

        Dim reader As SqlDataReader
        ' sqlCmd.Parameters("@KeyCustomer").Value = Row.CUNO
        reader = sqlCmd.ExecuteReader()
        If reader.Read() Then
            'do all field comparisons here to determine if
            '    the record changed since the last ETL.
            If (reader("Name").ToString() <> Row.Name) Then
                ' Row.DirectRowToUpdateRecordsOutput()
                Row.DirectRowToInsertRecordsOutput()
            ElseIf (reader("Name").ToString() = Row.Name) Then
                Row.DirectRowToIgnoreRecordsOutput()
            End If
        Else
            Row.DirectRowToInsertRecordsOutput()
        End If
        reader.Close()
        ' If sqlConn.State = ConnectionState.Open Then sqlConn.Close()

    End Sub
    Public Overrides Sub ReleaseConnections()
        connMgr.ReleaseConnection(sqlConn)
    End Sub
End Class

Thanks in advance.

Regards,

Vipin jha


Thankx &amp; regards, Vipin jha MCP

Matching a T-SQL date with a SSIS datetime variable - SSIS 2012

$
0
0

Hi,

in a my SSIS 2012 pkg I've created a datetime variable (I cannot to create a date variable) and I've read a SQL Server table to get a date column (without the time info) by using an Execute SQL task. I've put the date column value in an output parameter. When I try to run the package I've this error:

[Execute SQL Task] Error: Executing the query "SELECT cast(LAST_ELABORATION_DATE as datetime) FRO..." failed with the following error: "Value does not fall within the expected range.". Possible failure reasons: Problems with the query,"ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Any suggests to solve this issue, please? Many thanks

Assign Raw File Source into variables

$
0
0
I read data from a raw files source that have just one row. I want to assign each column to a different variable. How can I do it?

Sript Task and Excel

$
0
0

Hi All,

I have a requirement in which the task is to read data from .xls file and put it into a text file. The SSIS should read data from Excel cell A:4 to L:15. Only the data highlighted in Yellow should be loaded into text, other data in the excel should not be loaded into text file. The Month-Year value on the row is dynamic. Every month old month-year get deleted and new month-year gets added to the excel sheet. For example one month from now, Feb-15 will be deleted and Jan-16 will be added to the end.

Any help would be greatly appreciated.

I am using SSIS 2008R2

I have attached the input file(Excel Sheet) and also i have attached the expected output file(Text File).

Thanks

Syed

Adding footer with text and number

$
0
0

hi

i am using following code to  have footer in my file.

    Public Overrides Sub CreateNewOutputRows()
        Dim recordCount As Integer
        Dim vars As IDTSVariables100

        'Get the record count
        Me.VariableDispenser.LockOneForRead("RecordCount", vars)
        recordCount = CType(vars("RecordCount").Value, Integer)
        vars.Unlock()

        'Output one row with record count
        Output0Buffer.AddRow()
        Output0Buffer.FooterRow = String.Format("Footer Row Count: {0}", recordCount)
        Output0Buffer.SetEndOfRowset()
    End Sub

now my footer requirement is i need add following values

ABCxxxxxYYYYMMDDHHMMSS totalcount sum

here, xxxxx is file number generated so for example,its increamnet number ,fo first file it should be 00001,for second 00002

(how to do it?)

after xxxxx there is curent date and time in that format (how to do it here)

after that there is  1 single space and after that total number of rows in file (how to count it and use it here?)

then again single space and then total amount from file , if i have 5 row in file and amount column has 1,2,3,4,5

here total should be 15, how to do it in visual basic,

please guide me


Creating new column with hard coded values in SSIS

$
0
0

Hi ,

I have a constant value (such as 1/1/2015) in my source. I want to create a new column(col 1) with hard coded values.

How can i do it in SSIS.

col1   col2

A       1/1/2015

B       1/1/2015

C      1/1/2015

D      1/1/2015

E      1/1/2015

Microsoft Connector Attunity 3.0 in SSDT

$
0
0

Hi Gurus,

I'm trying to install Microsoft Connector for Oracle by Attunity v 3.0. I cannot see any Oracle Source or Oracle Destination in SSDT. I also cannot find how to add it manually.

I am refering installation guide from URL below :

https://technet.microsoft.com/en-us/library/ee470675(v=sql.100).aspx

I am currently using SSDT for Visual Studio 2010 with SQL Server 2014.

Is there anyone can help me with this? Thanks.

Script Task and Excel

$
0
0

Hi All,

I have a requirement in which the task is to read data from .xls file and put it into a text file. The SSIS should read data from Excel cell A:4 to L:15. Only the data highlighted in Yellow should be loaded into text, other data in the excel should not be loaded into text file. The Month-Year value on the row is dynamic. Every month old month-year get deleted and new month-year gets added to the excel sheet. For example one month from now, Feb-15 will be deleted and Jan-16 will be added to the end.

Any help would be greatly appreciated.

I am using SSIS 2008R2

I have attached the input file(Excel Sheet) and also i have attached the expected output file(Text File).

Thanks

Syed


Loop through excel file sheets in ssis

$
0
0

HI..

I have one excel file which is having dimensions meta data info in each sheet (One dimension info in each sheet) with same format. Sheet name having the dimension name.

Now, i want to access these sheets and load into my target table(look up on sheet name and target table name).

So, i need to perform 2 tasks now.

1) Loop thru all sheets in excel and

2) Save the sheet name in variable each time, using this variable to look up on target table name .

Can anyone help me to achieve this?

Deployed SSIS package not writing to text file

$
0
0

Hello.

I have a SSIS package that checks for records in a table and then sends information in an email to a person as well as log the information to a text file. This all works great in my BIDS program. I deployed it to the SQL server and set it up to run on a job it runs ok but it is not writing to the text file. If I log onto the server for Integration Services I am able to excute the package there and .it will write the information to the text file but when I set it up a job to run from the SQL Server Agent it runs fine but it is not writing to the text file. Any ideas? tks!


Reach for the unknown!

execute sql task - Input string was not in a correct format

$
0
0

hi

 i am using below statement and taking result into variable.

select sum(paymentamount) as totalamount  from [dbo].[SampleSourceData]

single row ,but getting error :

[Execute SQL Task] Error: An error occurred while assigning a value to variable "totalamount": "Input string was not in a correct format.".

any help?


SSIS packages are not visible in File System after deploymnet

$
0
0

 Hello, experts,

I created a SSIS pke (2008 R2), configuration file and manifest file on my computer. I then copied all three files to the testServer and deployed my package to the file system (D:\Test) of the server. I verified the .dtsx and the .dtsConfig files are all there. But when I connected to the server in SSMS and tried creating an agent job, the D:\Test directory is not available for browsing. Only  the folders on my local computer are available. When I connected to the integration services and checked in the stored packages folder, there is nothing there either.

Did I do anything wrong? How could I get my agent job "see" the deployed package on the other server? Your help and information is greatly appreciated.

Thank you in advance!



Changing date format using derived column

$
0
0

Hi,

I have input date as 1\16\2012. i want to change it to 20120116. and for 11\5\2012 it should be 20121105.

How can i do it in SSIS using derived column.

script task how to add date value

$
0
0

hi

i have following code i am trying to add date into script task

 Public Overrides Sub CreateNewOutputRows()
        Dim vars As IDTSVariables100
        Dim vars1 As IDTSVariable100



        Dim recordCount As Integer
        Dim rdate As Date


        ' Dim recount As Integer

        '  Dim rcount As Integer = 0

        'Get the record count
        Me.VariableDispenser.LockOneForRead("RecordCount", vars)
        recordCount = CType(vars("RecordCount").Value, Integer)
        ' rdate = CType(vars("CurentDate").Value, Date)
        vars.Unlock()

        Me.VariableDispenser.LockOneForRead("CurrentDate", vars)
        rdate = CType(vars("CurrrentDate").Value, Date)
        ' rdate = CType(vars("CurentDate").Value, Date)
        vars.Unlock()



        'Me.VariableDispenser.LockOneForRead("rcount", vars)
        'rcount = CType(vars("rcount").Value, Integer)
        'vars.Unlock()

        '  rcount = rcount + 1
        'Output one row with record count
        Output0Buffer.AddRow()
        Output0Buffer.FooterRow = String.Format("ABC" & recordCount & rdate)


        Output0Buffer.SetEndOfRowset()

in SSIS i have declare CurrentDate in datetime and i need to use it here , but i am getting error.

how to append its value to       Output0Buffer.FooterRow = String.Format("ABC" & recordCount & rdate)

its in vb ,i dotn know anything about VB ,please help me.

i havent put anything in  readonly,readwrite in script task.ecordCount is working but i did same  for rdate and its not working


script task destination

$
0
0

hi

i have 1 ssis variable which i am trying to use in my script task,but when i run its throwing an error.

how to use curentdate here.i am passing as a read only in script task

    fileContents.AppendLine(String.Format("ABC" & Dts.Variables("CurentDate").Value.ToString()))
        fileContents.Append(File.ReadAllText(Dts.Connections("Destination").ConnectionString))
        File.WriteAllText(finalFile, fileContents.ToString())

SSIS 2012 OData - Cannot acquire a managed connection

$
0
0

I have an SSIS project in SQL Server 2012 deployed via  VS 2012 SSDT-BI.

If I run this from my local SQL Server it works correctly, however if I push it to another server and run it I always get a

Cannot acquire a managed connection from the run-time connection manager.

The connection looks like this..

Document Url=http://myodata;Include Atom Elements=Auto;Include Expanded Entities=False;Integrated Security=SSPI;Persist Security Info=False;Time Out=600;Schema Sample Size=25;Retry Count=5;Retry Sleep=100;Keep Alive=True;Max Received Message Size=4398046511104
Any ideas?


Paul

CHANGE_TRACKING_CURRENT_VERSION

$
0
0

I am tracking insert changes only on 4 tables. I am using an SSIS package and stored procedures to return incremental changes to all tables to populate a data warehouse.

When the initial data is loaded into the database, the CHANGE_TRACKING_CURRENT_VERSION changes to 1. 

If I then run the SSIS package for loading the DW, it will not return any records as we are using the CHANGE_TRACKING_CURRENT_VERSION as the last sync version. 

Must we do an initial load before we enable change tracking and use CHANGE_TRACKING_CURRENT_VERSION?

Do we need to track changes to each table separately?

Do we need to use our own custom change tracking id?



Viewing all 24688 articles
Browse latest View live


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