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

Derived column syntax help needed

$
0
0
I am struggling getting the following case statement into the derived column format in SSIS




CASE 
WHEN SUBSTRING(REPLICATE('0', 9 - LEN(Data)) + CAST(Data AS VARCHAR(9)), 4, 6) IS NULL
THEN 0
ELSE RTRIM(SUBSTRING(REPLICATE('0', 9 - LEN(Data)) + CAST(Data AS VARCHAR(9)), 4, 6))
END

Here are examples for the data in Data
row 1 - 1201303
row 2 - 123456789
row 3 - null
row 4 - 12345678
the first row result would be 201303
row 2 result would be 456789
row 3 result would be 0
row 4 result would be 345678

Andre Toerien


delete a request in ssis

$
0
0

i alreadly add many requests in data profile task, but there is a request is added incorrect. so i want to delele that request, but i can't find a way to do this. please help me

SSIS package running from SQL Server Agent

$
0
0

I have an SSIS package running from the SQL Server Agent which creates several CSV files in for each loop. It has been running with no problems for over a year but the problem seems to be a limit on how large the CSV file can be. As time goes by the file because larger and does not up date the CSV file. It does update the smaller CSV file but not the large ones.  This package runs correctly from my computer in BIDS.  I don't know really what the problems is or how I can fix it.

Any help will be greatly appreciated.

SSIS package works from server only

$
0
0

Hi,

Setup (three servers involved - all have the same basic setup): 
OS: Windows Server 2012 R2 (X64)
DB: Microsoft SQL SErver 2012 - 11.0.5532.0 (X64)

Short description
Executing SSIS package from Server B fails when not logged on via Remote Desktop.
Using same administrator userid on all servers.
Should read flat file from Server C.

Details

I have developed a SSIS package on Server A (yes, I use a server as developer pc!). The SSIS package needs to read a flat file from server C. This works perfectly in my Visual Studio 2012 environment.

I now deploy the package to server B. Now the fun begins:

- If I log on to server B via Remote Desktop and opens MS Sql Server Management Studio (MSSMS) and then executes the job directly from my Integration Services Catalogs/SSISB... then it works like a charm.

- If I just open MSSMS from Server A and via MSSMS logs on to server B then the job fails! The error I receive is "Error: Flat File Source failed the pre-execute phase and returned error code 0xC020200E".

Going further down, I can see the error is "Access is denied".

The frustrating part is that I log on to the servers using the same userid- my administrator id. Also the file it should read from Server C is shared to Everyone has Full access (yes, I just want it to work for a start... Then I can always increase the security later!)

Any ideas on how to solve this?

Import Column properties are not available

$
0
0
I am trying to build a Import Column Transformation to import the data from a txt file. When I tried to set the properties of the input columns in the Advanced Editor for Input Column, The window on the right side only show 'Common Properties' with two rows named ‘CodePage’ and 'ComparisonFlags'. I cannot set the path between the input and the output. What is the problem of this situation and how can I solve it?

DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER

$
0
0

All,

 

I’ve come across an issue with a newly created package.  Several error messages are receved relating to the package's connection managers.   Each connection managers tests successfully.  However, the errors are thrown during package execution.  A similar issue was encountered in a separate package.  It was resolved by temporarily disabling package configurations.  That doesn't help in this case.  I did read other posts regarding package protection level which wasn't helpful in this case.

 

Any assistance you can provide would be helpful!

 

Thanks for your time,

Orlanzo

 

======================================================================

SSIS package "StageRef-Tier2_ODRBOND.dtsx" starting.

Information: 0x4004300A at Stage data to _Temp tables, DTS.Pipeline: Validation phase is beginning.

 

Error: 0xC0202009 at StageRef-Tier2_ODRBOND, Connection manager "Sybase.TIER2.odrisk": SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.

 

Error: 0xC020801C at Stage data to _Temp tables, ODRRisk_OTRData [1]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Sybase.TIER2.odrisk" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.

 

Error: 0xC0047017 at Stage data to _Temp tables, DTS.Pipeline: component "ODRRisk_OTRData" (1) failed validation and returned error code 0xC020801C.

 

Error: 0xC004700C at Stage data to _Temp tables, DTS.Pipeline: One or more component failed validation.

 

Error: 0xC0024107 at Stage data to _Temp tables: There were errors during task validation.

SSIS package "StageRef-Tier2_ODRBOND.dtsx" finished: Failure.

The program '[2384] StageRef-Tier2_ODRBOND.dtsx: DTS' has exited with code 0 (0x0).

 

======================================================================

 

Is there a way to combine the first two rows as the column headers?

$
0
0

Hello all! I have a file format that I've never worked with before, and I'm wondering how to handle the column headers. Please see the screen shot below.

For columns A, B, and C, the column headers are in the first row. But for the remaining columns, the column header is the combination of the first and second row. For example, the column header for D should be "UBPKE006 PROV_LNLS_ATTR_AA". Is there any way to collapse the first two rows into one row that I could use as the column headers?

Thanks for any suggestions!!


WeeLass

load data from Excel file

$
0
0
is there a way that we can import data from top 3 sheets of a excel in ssis?

SSIS puzzle - creating tables dynamically on destination server

$
0
0
Hey guys I thought this might also interest ya'll here:

Problem statement:
I have two servers S1 and S2 and the source table is in Server1. There is no destination table in Server2.
I want to move data from server S1 to S2 using a SQL command Select * into <Server2table> From <Server1Table> by creating the table dynamically. Linked servers are not allowed and this has to be done using SSIS. 
How should I approach this?



SSIS

$
0
0

Iam copying the data from a excel file to a database using SSIS.The excel file has a accounting  column to store money (ie $ 789.2344667) etc.
In database it has a currency column for the same. But when we copy the data running the ssis the value is rounded off to the 4th decimal place and the rest gets truncated. ie a value of 789.2344667 goes to 789.2345.
Can any body suggest me a way by which we can get the accurate value in the database.

SSIS : Importing EXCEL 97-2003 format fetching value as NULL for column having date type in excel

$
0
0

Hi ,

I am trying to import a xls file which has the first row as column names.

There are 5 date columns , out of which 3 date columns are importing correctly while other 2 is being read as null or truncated to some number only. The 3 columns being read correctly have values as date starting from row 1 while other 2 has NULL values initially and after may b 20 rows , it has a date values. When checking the input /output properties of excel source , it is retrieving datatype as DT_DATE for 3 columns while it is setting data  type for other 2 as DT_WSTR
(may be because it has null values) . How do I set it as DATE only or atleast fetch the correct date not truncated number ?

The connection string is :

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Excel1.xls;Extended Properties="EXCEL 8.0;HDR=YES;IMEX=1";

SSIS - value gets truncated from excel to database

$
0
0

Iam copying the data from a excel file to a database using SSIS.The excel file has a accounting  column to store money (ie $ 789.2344667) etc.
In database it has a currency column for the same. But when we copy the data running the ssis the value is rounded off to the 4th decimal place and the rest gets truncated. ie a value of 789.2344667 goes to 789.2345.
Can any body suggest me a way by which we can get the accurate value in the database.


The AcquireConnection method call to the connection manager

$
0
0

Hi ,

There is a sequence container in my SSIS Package having 3 task within it.
when I am executing all the task indivisually it workks fine, when I am executing my package all the task are success , except that copnatiner.below error I am getting

Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "localhost.*****" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.


This is a existing package on which I am working.

Protection level is EncryptSensitivewithUserKey
and TransactionOption is Required set on container

Please suggest me the way to get out from this issue.
regards,
Vipin jha


Thankx & regards, Vipin jha MCP

Getting exception while creating DTSX package programmatically in windows form application.

$
0
0

Hi all,

I am trying to create a dtex package programmatically. for that I have taken reference of

Microsoft.SqlServer.DTSPipelineWrap
Microsoft.SqlServer.DTSRuntimeWrap
Microsoft.SqlServer.ManagedDTS

but when I am trying to run the following line in windows form application

 package = new Package();

Its giving me FileNotFoundException

"Could not load file or assembly 'Microsoft.SqlServer.DTSRuntimeWrap, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified."

same thing if I run in console application if working perfectly without error.

If I change the Build platform 32 bit in my windows form application its working but I need to keep it Any CPU only.

Can anyone please tell me why its happening and please give me some idea how to overcome from it.

      

SQL Task Expression: SQL Command using variable tables

$
0
0

Hello,

I've got a question I hope someone could help me out with. I'm working on a SSIS project that basically synchronises logins of a Source and Destination server that are part of an AlwaysOn Cluster.

The idea is as followed: On the source server there are variable tables created named Logins_<SourceServerName>_To_<DestinationServerName> for example. This one is filled with all the login information from that server, then on the Destination server the same table is created and the data is transfered. The Source and Destination server names are project variables.

Once all data is copied I use a set of code from the dba_CopyLogins script I got from SQLSoldier (http://www.sqlsoldier.com/wp/sqlserver/transferring-logins-to-a-database-mirror) to create the missing logins on the Destination server.

What I've found is that I can't use expressions to handle the code, at least I haven't found a way yet, expression evaluation will give an error on (for example) the following code:

	  Begin
		Set @SQL = 'Create Login ' + quotename(@LoginName)
		If @Type In ('U', 'G')
		  Begin
			Set @SQL = @SQL + ' From Windows;'
		  End
		Else
		  Begin
			Set @PasswordHashString = '0x' +
				Cast('' As XML).value('xs:hexBinary(sql:variable("@PasswordHash"))', 'nvarchar(300)');

			Set @SQL = @SQL + ' With Password = ' + @PasswordHashString + ' HASHED, ';

			Set @SIDString = '0x' +
				Cast('' As XML).value('xs:hexBinary(sql:variable("@SID"))', 'nvarchar(100)');
			Set @SQL = @SQL + 'SID = ' + @SIDString + ';';
		  End


I've tried various things to get this to work as an expression, however I seem to continue to get the error:

The expression might contain an invalid token, an incomplete token, or an invalid element. It might not be well-formed, or might be missing part of a required element such as a parenthesis.

So the next thing I tried was just using the script as Direct input with Parameter Mapping on the tables but I've got the error:

Must declare the table variable "@P1". 

All the way up to @P12. Since we're talking about 12 variables that are in the script in total. But they are table variables and apparently Parameter mapping is not possible on table variables or am I wrong here? Pieces of code for example are:

Set @MaxID = (Select Max(LoginID) From ?)
Set @CurrID = (Select Min(LoginID) From  ?)

I hope there's someone who could help me out or at least can give me a direction to look into.

Yes we could use the script provided, but we don't want to work with LinkedServers, besides I'd have to make local jobs on the servers instead of controlling it all from 1 centralised server.

Thank for looking at the topic and I hope you have a clue about what to do...

Regards,

Danny


SSIS - Handling failures with agent log.

$
0
0

Hello, i have alot of SSIS jobs that run using the SQL agent to schedule and set them off.

What i am trying to do is, when the SSIS package fails i want to send the agent log of why it failed in an email and send it to a group.

I have all the code in place and emails are being sent out, however the issue is that the SSIS package is still running when it fails and i cannot see the error yet,  When the email gets sent out and the package is completed then the Agent writes the log to the MSDB db about the error. 

So i need to somehow make the agent write the log before my email generates.  Any ideas?

Rerunning the package on truncation error solves the issue..how?-Urgent help needed

$
0
0


I have an SSIS package which failed due to truncation error.I checked in my source and found that i have the option fail component on truncation checked.I did not alter anything, but just reran the package again and the error vanished.The data load was successfull without any issues.How did this happen? 

Couple of times when i get the truncation error, i rerun the package and it completes successfuly when i rerun it 2nd time.

At a high level,my package does only this.Truncates the staging table.Loads 2 days of data into it and finally loads my target table which is used for reporting purposes.

Any help and early response on this is much appreciated.!!

Also let me know if you need more details. This is the error from log.

Error   

Source: DEST INSERT ERROR EVENT 

Description: A truncation occurred during evaluation of the expression.

End Error

Warning: 2014-12-02 02:48:13.83
   Code: 0x80019002
   Source: OnError 
   Description: 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.
End Warning
Error: 2014-12-02 02:48:13.84
   Code: 0xC0202009
   Source: INSERT INTO DESTINATION INSERT_DESTINATION [16]
   Description: An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "The statement has been terminated.".
An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Violation of PRIMARY KEY constraint 'PK_table'. Cannot insert duplicate key in object target.table.".
End Error
Warning: 2014-12-02 02:48:13.84
   Code: 0x80019002
   Source: OnError 
   Description: 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.
End Warning
Error: 2014-12-02 02:48:13.84
   Code: 0xC001700E
   Source: DEST INSERT ERROR EVENT 
   Description: A truncation occurred during evaluation of the expression.
End Error

Before rerunning the package the checked for this

"Violation of PRIMARY KEY constraint 'PK_table'. Cannot insert duplicate key in object target.table.".

There were no violations! 

Thanks!!


JSON Webservices Issue

$
0
0

Hi All,

I have JSON web services , I am using script component to fetch data from Webservice to sql server table.

The code is working fine, if I am using sample JSON Webservice . http://www.geoplugin.net/json.gp?jsoncallback . But when I am using HTTPS:URL , it is giving below error .

[Error Getting Data From Webservice!] Error: System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

Thanks in Advance..

How to create temp tables in SSIS and use them in data flow task

$
0
0

Hi ,

My requirement is to get data from Server A and put it into ServerB. I have somany joins in the source query and some temp tables if the run the query in ssms it runs fine, but i put the same query in Data flow OLE DB Source task, i receive the error.

Below is my code, its too lareg but i dont think we need to worry about the code at all as its working perfectly fine

		Select dbo.hs_claim.hsclaimnumber as Claim_Number,	min(HS_PAYMENT_VW.hscheckdate) min_check_date,dbo.hs_claim.hsdatecreated
		into ##1
		from dbo.hs_claim left outer join dbo.hs_transaction TRANS on hs_claim.hsclaimid = TRANS.hsclaimid
						left outer join dbo.HS_TRANSACTION_CODE_VW TCode_VW on TRANS.hstransactioncodeid = TCode_VW.hstransactioncodeid
						LEFT OUTER JOIN HS_PAYMENT_VW ON TRANS.hspaymentid = HS_PAYMENT_VW.HSPAYMENTID
		where HS_PAYMENT_VW.hsstatus = 'Payment Complete'and TCode_VW.hstransaction = 'Payment'and TCode_VW.hstransactiontype ='Indemnity'
		group by dbo.hs_claim.hsclaimnumber,dbo.hs_claim.hsdatecreated


			 Select 	distinct dbo.hs_claim.hsclaimnumber as Claim_Number,t.min_check_date,qx_users.fullname as paid_by,s.value Specialty,o.value Office,

			 integrator.qw_fullname as Integrator,HS_PAYMENT_VW.hsreason,
				Payment_Method = case when HS_PAYMENT_VW.hs_eft_payment = 1 then 'EFT' else 'CHECK' END, HS_payee.hstype,
				Contact_Date =DATEADD(DAY, CASE DATENAME(WEEKDAY, GETDATE()) WHEN 'Friday' THEN 3 ELSE 1 END, getdate()),upper(rtrim(supervisor.qw_lastname)) as Team,
				HS_PAYMENT_VW.hscheckdate as Check_date,HS_PAYMENT_VW.hsreason as Payment_Description,dbo.hs_claim.hsdatecreated,qw_employee.hsspecialty
			into ##2

		from dbo.hs_claim left outer join dbo.hs_transaction TRANS on hs_claim.hsclaimid = TRANS.hsclaimid
			left outer join dbo.HS_TRANSACTION_CODE_VW TCode_VW on TRANS.hstransactioncodeid = TCode_VW.hstransactioncodeid
			left outer join dbo.HS_DD_CLAIMSTATUS_VW on hs_claim.hsclaimstatus = HS_DD_CLAIMSTATUS_VW.pkey
			LEFT OUTER JOIN HS_PAYMENT_VW ON TRANS.hspaymentid = HS_PAYMENT_VW.HSPAYMENTID
			left outer join dbo.hs_transaction_code on TRANS.hstransactioncodeid = hs_transaction_code.hstransactioncodeid
			left outer join   qx_users ON HS_PAYMENT_VW.hscreatedby = qx_users.loginname
			  left outer join qw_employee on qx_users.pkey = qw_employee.qw_userid
			  left outer join HS_DD_OFFICE_VW as O on qw_employee.hsoffice=O.pkey
			 left outer join HS_DD_SPECIALTY_VW s on qw_employee.hsspecialty = s.pkey
									   left outer JOIN qw_employee AS Supervisor ON qw_employee.qw_managerid = Supervisor.qw_userid
									   left outer join hs_payee on HS_PAYMENT_VW.hspaymentid = hs_payee.hspaymentid
									   left outer join qw_employee as integrator on integrator.qw_userid=dbo.hs_claim.hsintegratorid
									   inner join ##1 t on t.Claim_Number=dbo.hs_claim.hsclaimnumber and t.min_check_date=HS_PAYMENT_VW.hscheckdate
		where HS_PAYMENT_VW.hsstatus = 'Payment Complete'and
		TCode_VW.hstransaction = 'Payment'
		and TCode_VW.hstransactiontype ='Indemnity'  and hstype =1 and integrator.hsspecialty<>68


	group by  dbo.hs_claim.hsclaimnumber ,qx_users.fullname  ,integrator.qw_fullname ,HS_PAYMENT_VW.hsreason,t.min_check_date,supervisor.qw_lastname,
				 HS_PAYMENT_VW.hs_eft_payment , HS_payee.hstype, s.value,o.value,
				HS_PAYMENT_VW.hscheckdate ,HS_PAYMENT_VW.hsreason ,dbo.hs_claim.hsdatecreated,qw_employee.hsspecialty
		 having convert(date,t.min_check_date,101) =
		case
		when HS_PAYMENT_VW.hs_eft_payment=1 and datepart (weekday, dateadd( DD, -6, getdate())) in (1,7) then convert(date,DATEADD(dd,-4,getdate()),101)
		when HS_PAYMENT_VW.hs_eft_payment=1 and datepart (weekday, dateadd( DD, -6, getdate())) not in (1,7) then  convert(date,DATEADD(dd,-6,getdate()),101)
		when HS_PAYMENT_VW.hs_eft_payment=0 and datepart (weekday, dateadd( DD, -14, getdate())) not in (1,7) then convert(date,DATEADD(dd,-14,getdate()),101)else null end

			   SELECT hs_comments.hsDateCreated AS Date_created,dbo.HS_CLAIM.hsClaimNumber CLAIM_NUMBER ,  dbo.qw_employee.qw_fullname as full_name,hsnote
			   into ##3
			FROM         dbo.HS_CLAIM INNER JOIN dbo.hs_comments ON dbo.HS_CLAIM.hsClaimId = dbo.hs_comments.hsobjectid
								left outer join   qx_users ON
									(case when hs_comments.hscreatedby= 'Kpullo' then 'KDavidson'
												when hs_comments.hscreatedby= 'LRoss' then 'linette.august'
												when  hs_comments.hscreatedby= 'ntarry' then 'nnaylor'
												when hs_comments.hscreatedby= 'Katee.Flesher' then 'Katee.Parton'   else hs_comments.hscreatedby end )

								 = qx_users.loginname
								left outer join qw_employee on qx_users.pkey = qw_employee.qw_userid

			WHERE     dbo.hs_comments.hsaction in (1) and year(hs_comments.hsdatecreated) >= year(getdate()) and
			           hs_comments.hsnote like '%PPC%'


	select t2.Claim_Number,t2.Check_date as First_ACV_Payment,t2.Contact_Date,t2.specialty,t2.Office,t2.Integrator,t2.paid_by,t2.Payment_Method,t2.Payment_Description,t2.Team,DATEDIFF(day,t2.hsdatecreated,t2.Check_date) as Cycle_Time,t2.hsdatecreated,'QX' AS LoadSource
	from ##2 t2
	left outer join ##3 t3
	on t3.claim_number =t2.claim_number and  t2.min_check_date < t3.date_created
	where t3.CLAIM_NUMBER is null and year(t2.hsdatecreated)=year(getdate())
	order by t3.claim_number asc



			drop table ##1
			drop table ##2
			drop table ##3

The error i receive in Data flow task is   "Invalid object Name ##1". May be i need to change the way i am dropping the tables?

Can someone please help me with any suggestions on this?

Thanks

SSIS SharePoint view getting all columns

$
0
0

I'm using BIDS 2008. I'm using SharePoint list source adapter. I have a SharePoint - http://abc.com/test. Listname=test. In this list, I have105 columns. I want only 5 columns out of 105 columns, so I have created 'test_v' (consists of 5 columns) in SharePoint.I have given component properties in SharePoint list adapter

SiteListName=test

SiteListViewName=test_v

SiteUrl=http://abc.com/test

When I go to column mapping tab, I'm getting 105 columns. Here, I want 5 columns only in this tab. I do not want all the columns, which is pain process to delete. How do I handle this?

Viewing all 24688 articles
Browse latest View live


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