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

Process Task - execute .bat file does not get executed

$
0
0

I need to run a .bat file to FTP files to mainframe.   I setup a process task and point to the .bat file.

I ran debug and it is all green, but the file does not get FTP to the mainframe.  If I double click the .bat file and it ran also and the files are in mainframe.

I am not sure if the bat file gets run or not.  I used another method by setup the cmd.exe first and set up the path on the argument.  it does not work also.

I am clueless now.  Since is the in developement, erverything is running from my C drive. I do have local instance of 2008 and also intergration services is running with local admin account.   Please help.


W.E. Pan


Cant update connection string property from variable

$
0
0

Hi All

I am doing this:

http://microsoft-ssis.blogspot.no/2011/02/script-component-as-source.html

I have this example setup in a foreachloop which shreds a file name from a recordset into a variable.

All is working well. But I am trying to change the ConnectionString to the variable @[User::FileName] in the connection Expression properties. I have the variable changing from a foreachloop and have stepped through this to ensure the variable are changing. However this does not appear to be updating the Expression in connection property.

BTW I have the variable set as a  readwriteVariable in the script tranformation editor

Any ideas?

Thanks

BiF

VBS Script 32 bit to 64 bit machine

$
0
0

I have this VB Script that works with an SSIS package. It runs the SSIS package and inputs the dates based on the value that is returned- "W" for week or "M" for month, it then puts the start and end date of either the month or week into an access table. I did not create this but I am trying to move the whole SSIS package over to a new server that is a Windows Server 2008 R2 64 bit operating system.

Below is the original Script I have tried everything to get this up and running and I am not sure what else to try.

I have tried to change the dates in SSIS but have not been able to find a way, I have tried to convert this to a VB.net file and run it, and that has not worked, I have tried altering the connection to every kind imaginableand I have looked up switching it a bat file... Any other ideas?

If I could at least populate the dates in access that would great and I could figure out what to do from there. The dates are needed first at the SSIS package uses them when it runs!

Thanks!

'#################################################
WEEKLY version
'#################################################

Dim varPath 

'#####SET SSIS PACKAGE PATH#####
varPath = "\\C:\Package.dtsx"
'###############################
'#############################
IsThisMonthOrWeek = "W"
'#############################

'###CALL SUB###
PopulateMonthWeek
'###############

Set WshShell = WScript.CreateObject("WScript.Shell")

ReturnCode = WshShell.Run("%systemroot%\Syswow64\cmd.exe /C C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\dtexec.exe/FILE """ & varPath & """ /MAXCONCURRENT "" -1 "" /CHECKPOINTING OFF  /REPORTING EWCDI  ") 

'#########################################################################################

SUB PopulateMonthWeek
 set con = createobject("ADODB.Connection")
 dbPath = "C:\dealer.mdb"

 conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath & ";User Id=admin;Password=;"

 con.open conString

 IF IsThisMonthOrWeek = "W" THEN
  con.execute "update tbl_startEndDates set weekOrMonth = '" & IsThisMonthOrWeek & "', startDate = '" & getFirstDayOfMonth & "', endDate = '" & getLastDayOfMonth & "'"
 ELSE
  con.execute "update tbl_startEndDates set weekOrMonth = '" & "W" & "', startDate = '" & Date() - WeekDay(Date())-6 & "', endDate = '" & Date() - WeekDay(Date()) & "'"
 END IF

 

 con.close

 set con=nothing
END SUB 

FUNCTION getFirstDayOfMonth
 valMonth= month(now())-1
 valYear= Year(now())

 if valMonth = 1 then
  valMonth = 12
  valYear = valYear-1
 end if

 getFirstDayOfMonth = valMonth & "/1/" & valYear
END FUNCTION


FUNCTION getLastDayOfMonth
 valMonth= month(now())-1
 valYear= Year(now())

 if valMonth = 1 then
  valMonth = 12
  valYear = valYear-1
 end if

 din = valMonth & "/1/" & valYear

 getLastDayOfMonth = dateserial(year(din),month(din)+1,0)
END FUNCTION 

Moving SSIS 2008 packages stored in msdb between servers

$
0
0

Hi everyone,

I found a few similar posts but none answered my question.

I need to be moving SSIS packages stored in msdb from one Sql server to another. This will be done on a regular basis and the number of SSIS packages is about 100. All packages are regularly updated thus they need to be regularly copied to the second Sql server.

COuld you please suggest the best options for this - I am thinking of backup and restore of the msdb database but I am not sure if this is the easiest and best way to do the SSIS packages movement.

Thanks in advance

SSIS Error: Can not convert between unicode and non-unicode string data types (Oracle to MS SQL 2008R2)

$
0
0

Hello,

By using SSIS (VS 2008), the target is to migrate data from a table in Oracle to a table in MS SQL 2008 R2.

In the Data flow Task, OLE DB Source gets the field in "string[DT_STR]" and the OLE DB Source filed in "Unicode string [DT_WSTR]". The process gets an error, which is: "Column XXX can not convert between unicode and non-unicode string data types".

[Source filed data type: Varchar2(30) and Target filed data type: NVarchar(30)]

Used a "data conversion" between source and target for the field XXX but it did not help.

Changing the data type of the field XXX in the target table to varchar can solve the problem. However, I want to keep on using nvarchar as the target field data type.  Any ideas?


Sedso

Using Table Variable in OLE DB Source

$
0
0

 

Hi,

 

I have used a Table Variable in an SQL script to retrieve data from a source databse using the OLE DB Source Data Flow tool. The OLE DB Destination recognises the table and allows the columns to be mapped, but when the SSIS package is run no data is returned to the destination table.

 

The last line of the SQL Command in the OLE DB Source is :

 

SELECT

* FROM @Var

 

The SQL code executes correctly in the SQL Management Studio.

Have I run into a scope problem?

 

Cheers

Wee!

Dynamic column mapping in script component with different source and destination column names

$
0
0

I'm developing a dynamic package which creates the source and destination dynamically from the input parameters. Currently It just creates the source and destination components alone and do the mapping. Its working fine with direct mapping. For example, if the source and destination table has same number of columns, data gets loaded provided the data type and the sequence is same. If the source and destination has different count of columns and we want to map the source to particular columns at the target table, how can we achieve this?

Loading 40 tales into one

$
0
0

HI guys,

can anyone help me in this secanrio i have 40 tables in sql server and i need to combine it and load it into one table in the same server. 

any help will be appriceated.

thanks

ravilla.




Execute Package in Loop

$
0
0

Hi

I have to Re-Execute Pacakge on Error.

So, i did as below.

On Task Failure -- > Call Execute Package "PackageLoop"

on the "PackageLoop", I have called Execute Package "PacakageMain"

I am getting error


Warning: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.
  The Execution method succeeded, but the number of errors raised (3)
  reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.


ShanmugaRaj

ssis

$
0
0

COULD YOU PLEASE HELP ME FOR THE FOLLOWING SCENARIO:

SOURCE(100 RECORDS)

|

|

DEST(80 RECORDS)

WE HAVE TO FIND THE MISSING ROWS ALONG WITH ERROR DESCRIPTION?

Few questions on SSIS (basic)

$
0
0

Hello,

        if anyone can help me to understand these concepts,

How will you make sure that all rows from src populated to the target table

example : There are 3 million records in source file and 2.8 million records got loaded to target table. How will you make sure that remaining  records not dropped in between transformation. Assuming that data quality at source level is good.

You have 5 years of data without any timestamp in a database. If you want to update some information for previous year, Which sql will you use to update some mismatch record

       How will you handle error in ssis


ANK HIT - if reply helps, please mark it as ANSWER or helpful post

Give one line spare SSIS package

$
0
0

Hi Friends,

I have a small question. I was using Pulling data from TWO tables and loading into one text file.

So my Question is I want to give one line  gap between those two tables data like this 

How it is possible ? Could you please help on this.

Note: I dont want to create views and in that joining all the columns.

Thanks,

Ramakrishna

 

Redirect CFLF rows and retain LF rows

$
0
0

Hi Gurus,

I have flat file which is delimited by LF if I get CRLF i need to redirect to err_record

How to check this condition ?

thanks,

Sathish

External and Output Columns in OLEDB datasource

$
0
0

Hi,

             Can any one tell me,what is the difference between data type changing option in External Column and Output column in Advanced editor of OLEDB Source? If i want to change datatype of one of my column,whether i need to change both? Same thing is there in OLEDB Destination as well.But there input column datatype is not active.Can ny one explain?

 

Login fails for non-trusted connection in SSIS Script component

$
0
0
I have a script component in a data flow of my SSIS pacakge that uses the package connection manager to connect to the database.  Up until now, the connection manager was using a trusted connection to a local SQL Server and was working fine.  I had to switch the connection to non-trusted and use a SQL account to access a development SQL Server on another domain and now my script component won't validate giving me the error: "Login failed for user 'SSISUser'"
 
Other components in the same package are able to access the data using the same connection manager with no problem (e.g. an OLEDB Source).
 
Code in the Script task is establishing the connection to the SQL Database like this (FYI...Connections.UtilityConnection.Connectionstring is the reference to the SSIS Connection Manager):
 
oledbConn = New OleDbConnection(Connections.UtilityConnection.ConnectionString)
oledbConn.Open()oledbCmd = New OleDbCommand
Is there a reason that the code in the script component can't use a non-trusted connection or is there some other way I should be establishing the connection?
FYI...The connection string is coming from a configuration file and I have confirmed that the connection manager is being configured when the package loads.

SSAS Connection not been picked up from Config Db using an expresion

$
0
0

I have an SSIS package to process an SSAS cube .

An expression is used to set the connection string from a variable .If I hard code the variable the package runs sucessfuly. when I then set the variable to be set from a configration table it errors.

I have set up a break point before it gets to the processing task and can see that the variable has the correct value in it but it still error .

Any ideas ?

Is there any way that user defined variable on a sequence container affects the name of the sequence container?

$
0
0

I have a sequence container and I defined a user variable called "Container_Name" for logging purposes. When I renamed the container, I forgot to change the value of the variable. I saved the package. Next time when I opened BIDS and added the saved package to the SSIS Packages list, the sequence container got renamed to the value of the variable "Container_Name".  I do not understand because I hard coded the name of the sequence container. I do not know why the variable is affecting the name of the container.

Any ideas? 

Thanks

Aj

 

SSIS 2008 converts date to DT_WSTR

$
0
0

Hi,

I am using an oledb source with the following select 

SELECT [EmployeeKey]
      ,[EmployeeBK]
      ,[SuperiorEmployeeBK]
      ,[Name]
      ,[FirstName]
      ,[DateOfBirth]
      ,[EntryDate]
      ,[EndOfProbationDate]
      ,[SeparationDate]
  FROM [dbo].[DimEmployeeCurrent]

The table looks like this

[DimEmployeeCurrent](
	[EmployeeKey] [int] NOT NULL,
	[EmployeeBK] [int] NULL,
	[SuperiorEmployeeBK] [int] NULL,
	[Name] [nvarchar](50) NULL,
	[FirstName] [nvarchar](50) NULL,
	[DateOfBirth] [date] NULL,
	[EntryDate] [date] NULL,
	[EndOfProbationDate] [date] NULL,
	[SeparationDate] [date] NULL,
)

SSIS now converts the date columns to datatype DT_WSTR. Why?

Thanks

Andi

Nulls created by SS Agent, but not IS

$
0
0

I'm moving Avaya CMS data from Informix to SQL Server.  I have several data flow tasks - one per table, and some of them work fine in any circumstance, while other work fine when executed manually from Integration Services, but will produce different results when run via SQL Server Agent.

I created a new package just to test the root.hvdn table (phone data summarized by the half hour).  Avaya says the table is supposed to be keyed on row_date, starttime, vdn (the internal number - similar to extension) and vector; in truth, there are some duplicates, but with valid (i.e, different, call data - probably for a call that crosses an interval).  The row_date and vdn fields won't map directly, so they go through a converstion where the row_date converts to DT_DBDATE and the VDN to DT_STR.

The next step is to see which of the Informix records have been previously imported, so it goes through a lookup transformation matching the coverted row_date and vdn, along with the vector and start time against a SELECT DISTINCT of the same fields in the destination table (which eliminates the dupe keys).  So, it there's no match, the Informix data goes through a record count to variable (for the sucess email).

The final step is an OLE DB Destination.

When executed through BIDS or the deployed package on Integration Services, the package runs fine.  When I schedule it or run it from SQL Server Agent it runs, but inserts a zero length value into the vdn field - every other field is fine.  In the version of the package with multiple data flows, some tables update correctly every time, and others have this same type of error.  It's as though the conversion works correctly in BIDS, but when running from SQL Server Agent, the vdn is converted to a zero length value, which is a no match and results in an append of the entire record set, but without the vdn.

I've reduced the number of candidate records from Informix by limiting it to row_dates greater than yesterday.  That just gives me fewer appends with zero length vdns.  I don't want to truncate the destination table because I need to retain records that Informix has previously deleted - it maintains a two-month history, and I need to go back at least two year (eventually).

I'm at a loss.  The only thing I can think of is that the destination vdn field is Char(7), but I'm not sure.

Suggestions?  Insights?

Tim Mills-Groninger

Record ID for New Records in SSIS Data Flow

$
0
0

Requirement: need to have a sequence number for Primary key in Dimension table along with surrogate key. Basically Sql Server does not allow two IDENTITY columns, i try to create sequence number by using script component, code seems correct but encountering errors while passing new records through script component in Dataflow (using script component for trasformation).

Created a user Variable to get the maximum sequence number from that dimension and script component should create sequence numbers from maximum number onwards

user::wellFacID data type Int32

Column: FacIdCount data type numeric(9,0), tried with DT_I4

encountering bellow error when package runs. if you are familier with bellow error, please post your responses, thanks

[Script Component [1169]] Error: System.Runtime.InteropServices.COMException (0xC0010009): Exception from HRESULT: 0xC0010009    at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)    at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)    at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper90 wrapper, Int32 inputID, IDTSBuffer90 pDTSBuffer, IntPtr bufferWirePacket)

' Microsoft SQL Server Integration Services user script component

' This is your new script component in Microsoft Visual Basic .NET

' ScriptMain is the entrypoint class for script components

Imports System

Imports System.Data

Imports System.Math

Imports Microsoft.SqlServer.Dts

Imports Microsoft.SqlServer.Dts.Runtime

Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper

Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

Public Class ScriptMain

    Inherits UserComponent

    Dim rowcounter As Integer = 0

    Dim RowString As String

    Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

        'rowcounter = CType(Me.ReadOnlyVariables("User::WellFacID").Value, Integer)

        RowString = Me.ReadOnlyVariables("User::WellFacID").Value.ToString

        rowcounter = CType(RowString, Integer)

        rowcounter = rowcounter + 1

        Row.FacIdCount = rowcounter

    End Sub

End Class

Viewing all 24688 articles
Browse latest View live


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