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

Loading hundreds of flat files with different schema into SQL SERVER

$
0
0

hi folks:

  I am working on a project to retire an ERP system . One of the task is to output the ERP data  into different flat files and transport to a database. As a result, there are hundreds of flat files and each of them represents a table.  

  I am wondering if there are any automated way to load these flat files into sql server as the manual process to create one file manager at a time is just not doable.  Each flat files contains data types such as string, integer, boolean, etc. 

 Thanks

 Hui


--Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --


SSIS Package on 2008R2 Error when Called from SSIS 11.0 (2012)

$
0
0

Hi,

I have SSIS packages developed for SSIS 2008R2. A new server has been setup and runs SQL Server 2012 (Integration Services 11.0). The packages are called from this new server.

When the package is executed with dtexec it gives this message:

Found SQL Server Integration Services 2008 Script Task "ScriptTask_e38c7fc314034e3daf8a968c7a42c2fe" that requires migration!

What do I need to do to ensure the packages run successfully?

Thanks!



SSIS 2012 was running perfectly in design mode(BIDS). But after deploying , Script Task is not working

$
0
0

Hi All,

I have a SSIS package created using VS 2012 . It has a Script Task (C# code) to validate some files loading. But after deploying , the package is erroring out. But after removing/disabling the Script task , it works perfectly.

Error is  " The Script Task is corrupted., Source:<Script task name>, SubComponent:, IDOfInterfaceWithError:{8266A638-4A4B-4A82-8648-F54B5B879197}, HelpContext:0"

The SSIS package is scheduled using a Windows service application and executing programmatically. 

Thanks

Sujo

Sending HTML body in Emails

$
0
0

I have been tasked to create SSIS ETL package do replace a MS Access load App. I have developed the load package but it requires a summary of the load be sent by email upon completion. I have included a example of the email below. I am having a hard time figuring how to reproduce the summary table. I would like to make it a HTML formatted email. I came across this article  http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/62678/ by Paul Clancy but I am having difficulties getting it to work. When I run the query on the server I get XML output. When I run it in SSIS Execute SQL Task I get   Value <ROOT><?MSSQLError HResult=\"0x80004005\" Source=\"Microsoft XML Extensions to SQL Server\" Description=\"No description provided\"?></ROOT>\r\n " And the result is a blank page. The article was written in 2010 why wont this work? Is there another way I don't know about?



ssis package not working

$
0
0

I am getting the below mentioned error message when running the SSIS package through the SQL Server agent.

Error: Opening a rowset for "Test_Table$" failed. Check that the object exists in the database.
Error: "Excel Source" failed validation and returned validation status "VS_ISBROKEN".

SQL Server 2014 Enterprise edition 64 bit

windows server 2012 r2 data center edition

Any suggestions.


ODBC driver gives error while executing stored procedure when Money and SmallMoney has Currency Symbol.

$
0
0

Hello,

We are migrating our application which was using SNAC OLEDB. Now it will use Microsoft ODBC Driver 11.

Problem:

  1. Application calls the stored procedure using ODBC driver 11.
  2. Stored Procedure is having Money and SmallMoney as its input parameter.
  3. When these datatypes have currency symbol in its input( Ex. $123), ODBC driver is unable to handle it and it gives error "[Invalid character value for cast specification]" (SQL state 22018).

Question:

Is there any way by which ODBC driver can handle Currency Symbol? We are using ODBC API SQLBindParameter to bind Store procedure parameter and SQLExecDirect to Execute Stored procedure command.

Regards,

Seema

Datetime datatype Binding as input/Output parameter in stored procedure using ODBC driver 11

$
0
0

Hello,

We are migrating our application which was using SNAC OLEDB. Now it will use Microsoft ODBC Driver 11.

Problem:

1. Application calls the stored procedure using ODBC driver 11.
2. Stored Procedure is having datetime related datatpyes (DateTime, DateTime2, SmallDateTime)) as its input parameter.
3. Now when I provide datetime in basic ISO format yyyy-MM-DD HH:MM:SS ODBC gives error. (Invalid character value for cast specification or invalid date format)
    While in case of OLEDB, it was handling any date format (yyyy-mm-dd or MM-DD-YYYY etc) using the Dataconvert API. (https://msdn.microsoft.com/en-us/library/windows/desktop/ms715945%28v=vs.85%29.aspx ). Is there any such API for ODBC?

4. I am using ODBC APIs
      1) SQLBindParameter
      2) SQLExecDirect  for stored procedure execution.


Note: Date datatype supports YYYY-MM-DD with C dataype having SQL_C_CHAR while any other datatype is not working.

Question:

How to support datetime datatype with ODBC driver 11. Is the any specific guidelines to follow? if any sample is available that will be great.

Regards,

Seema

   

seema

MS Access to SQL Server: Script Primary Keys, Indexes and Foreign Keys

$
0
0

Is there a tool or script I can use to script out Primary Key, Index and Foreign key definitions from MS-Access for running on SQL Server?

I just loaded an MS Access database into SQL Server using the SSIS Import/Export wizard.  It worked fine but didn't include any key definitions or FK relationships.

I need to set these up but don't want to do it by hand to avoid errors and omissions.


Dynamically column concatenation in ssis

$
0
0

Hi,

I need to dynamic concatenate columns in script task and then further need to populate that in error table.

So i have some constraints on Staging data , that if 1 column is NULL then move whole row to script task where it will concatenate all columns ito 1 and then put that concatenated string in error table column..

i am very weak in scriptiong..plzz help...


Mike


Date format in SSIS expression

$
0
0

Hi Can anyone help me to produce date format in below given in manner with ssis expression

I want this output 

01-feb-2016

in ssis expression

Kindly help me for this


Abhishek Parihar BI Consultant (Please mark the post as answered if it answers your question)


Dynamic Output Filename In SSIS

$
0
0

i have a SSIS Package which is loading data from different customer , at a time 1 customer only
 after loading data there some computation and calculation occured and load it to 1 table.

i used oledb source and flatfile destination to fetch the data

but how can i named that flatfile as customer name . the customer name is available in 1 of the column in a table



May somebody kindly provide detail if it is acheivable i tried to google it
but not got satisfactory result.

Please help me.

.csv file and tab delimiter in SSIS

$
0
0

Hi All,

I am using flat file source to read .csv file. I tried using comma as Column delimiter but the moment any record in .csv file has 
comma in a particular record for example a record "1,000 oz" or "Atlanta,GA" , it gives me incorrect data. i tried using tab 
as delimiter but all the column values were getting displayed in 
the first column instead of individual columns. Is there any way to read .csv file with flat file as source and tab as column delimiter.

Is there any way possible to utilize SSIS to pump SQL Server data into Excel which uses #Temp Tables?

$
0
0

So I have a SQL Server Stored Procedure that creates like a dozen #Temp Tables and then utilizes those #Temp Tables to derive more information prior to Selecting a final result set. When I try utilizing an OLE DB Command task to run my SQL Server Stored Procedure, it's erroring because it has nothing to map data and Metadata with because of these #Temp Tables. Like trying to fit a square peg into a round hole here. I tried Retaining Connection and Delaying Validation but nothing seems to work.

Can anyone point me in the right direction here?

Thanks for your review and am hopeful for a reply.

ProvideX to SQL Server table

$
0
0

Hi Everyone! 

I have data in ProvideX and would want to put in a sql server table. Would it be possible with SSIS or with some any additional add-on's using SSIS?

Thanks.


- please mark correct answers



Using Variable in conditional split.

$
0
0

Hi,

I am using conditional split in my package. I want to split the data dynamically. for examply right now the split is based on the below condition:

Commodity Code =="NG" ||Commodity Code =="ON"

Can we add another commodity code or delete any existing commodity dynamically. If i want one more code like

Commodity Code == "YT", can we add dymanically or everytime i have to open package and hard code the new value?


Import data from csv to SQL server table

$
0
0

Hello,

I am trying to import data from a csv file to sql server table. I am importing based off a ssis package with data conversion. Here is ddl for the table:

CREATE TABLE [dbo].[Email](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[IP] [varchar](30) NULL,
	[Response] [varchar](900) NULL,
	[CreatedAt] [datetime] NULL,
	[FirstName] [nvarchar](60) NULL,
	[LastName] [nvarchar](60) NULL,
	[Title] [nvarchar](60) NULL,
	[ComapnyName] [nvarchar](60) NULL,
	[TypeOfBusiness] [nvarchar](60) NULL,
	[Address] [nvarchar](60) NULL,
	[City] [nvarchar](60) NULL,
	[State] [nvarchar](60) NULL,
	[ZipCode] [nvarchar](20) NULL,
	[EmailAddress] [nvarchar](60) NULL,
	[VerifyEmailAddress] [nvarchar](60) NULL,
	[PhoneNumber] [nvarchar](24) NULL,
	[PhoneExtension] [nvarchar](20) NULL,
	[PromotialCode] [nvarchar](60) NULL,
	[HowDidHear] [nvarchar](60) NULL,
	[NatureOfInquiry] [nvarchar](60) NULL,
	[AdditionalComments] [nvarchar](4000) NULL,
	[SCRM] [text] NULL,
	[Prefix] [nvarchar](30) NULL,
 CONSTRAINT [Email] PRIMARY KEY CLUSTERED
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Email] ADD  CONSTRAINT [DF_Email_GetdateValue]  DEFAULT (getdate()) FOR [CreatedAt]
GO

In the conversion I used String[DT_STR] for IP column and used Unicode String[DT_WSTR] for the rest of the columns. The mapping was good and the insert was also successful but  it shows values in double quotes for the following fields

ComapnyName, Address,City,State and additionalcomments

but showing correctly for the remaining fields.

Am I doing something wrong in the conversion? 

Thanks a lot for the help in advance

SSIS Import

$
0
0

I have 2 tables with the following columns and data.

Table1

ClientD                NoteID                AssessmentDate

5                             17                          01/01/2015

6                             20                          02/02/2015

7                             23                          02/01/2015

5                             44                          01/01/2015

7                             52                          02/01/2015

5                             54                          01/01/2015                        

Table2

ClientD                NoteID                AssessmentDate             ReviewDate

5                             54                          01/01/2015                        07/07/2015

6                             20                          02/02/2015                        02/02/2015

7                             52                          02/01/2015                        09/04/2015

Basically table2 imports records from table 1 but with the following conditions:-

If there is only one record for a ClientID in Table1 (ie ClientID 6), then Table2.ReviewDate = Table1.AssessmentDate.

If there are more than one record for a ClientID in Table1 (ie ClientID 5 and 7), then take the record with the highest NoteID and leave Table2.ReviewDate unchanged.

Note, once records are created in Table2, the ReviewDate  get updated by another process but this needs to remain the same if another record with the same ClientID is added to Table1.

SSIS -Error handle at data level

$
0
0

Hi guys, my name is Rob , i am pretty new in SSIS and working in some company.. so yesterday i got some assignment for error handling at data flow level..

1) IF any not null column is coming null , then concatenate all row as string and save in a err table(dynamically) along with inbuilt column error description...

2) if duplicate in code , then 1 row in destination and 1 row in error table

3) data truncation issues , then err table

Err table

Id  ,Error description  ,Err_row(Will be concat)

Sample

Create table stg_Employ
(
Eid INT ,
Name varchar(5),
age int ,
Dept varchar(8)
)

--INSERT into stg_Employ
--select 1,'rob',20,'HR'
--UNION ALL
--select 2,'mike',NULL,'Finance'  ---- age = null
--UNION ALL
--select 3,'UK',25,'admin'

--UNION ALL
--select 3,'UK',25,'admin'  -- duplicate

--UNION ALL
--select 4,'america',25,'anb'

--dest table

Create table stg_Employ
(
Eid INT primary key,
Name varchar(5),
age int not null,
Dept varchar(8)
)

i have given 3 scenarios dere....

I know there are many experts here..Can you help me with Reusable componant , i need to do same for many packages .or some exact c# code which can handle all....but with ease..

thanks


rob

SSIS Catalog not logging ForcedExecutionValue for containers

$
0
0
I set the ForcedExecutionValue = 1, ForceExecutionValue=True, and ForcedExecutionValueType=int32 for a task in an SSIS package. When I query SSISDB.catalog.executable_statistics I see that value (1) in the execution_value column. When I do the same thing for a container (Sequence, For Loop, or ForEachLoop) the execution_value column in SSISDB.catalog.executable_statistics is NULL. Is this a bug in SSIS Catalog logging? I don't know why it wouldn't log that value since they're both just considered executables in SSISDB. This is driving me nuts.

Getdate() - ? has error of two days in OLEDB data source in dataflow task

$
0
0

Hi

I am facing issue in dataflow with OLEDB source when I use getdate() -? . It calculates result incorrectly when using parameter and is fine when hardcoded (for instance getdate() - 2 )

I am using SQL Server 2012 SSIS and connecting to SQL server 2012 instance

In my SSIS package I have dataflow task that is pulling data from source system based on delta timestamp. I am using OLEDB source from SQL server 2012 for this operation

Query looks like this:

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

select a,b,c,d from table where timestamp >= getdate() - ?

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

Then I configure package parameter delat_days_back  int32 to pass as query parameter above so I can control size of my delta.

When executing this query I found out that expression  getdate() - ? actually returns  (getdate() - ? +2 ). As result when I set parameter delat_days_back = 2 then query returns no data.

To test this issue I created simple test flow

1. Created dataflow task and added OLEDB source with query text

select   'current_getdate' test_name ,    getdate()    as test_result
union all
select   'date_minus_days_back_expected ' test_name ,  getdate() - 4   as date_minus_days_back_expected
union all
select   'date_minus_days_back_actual' test_name,   getdate() - ?   as date_minus_days_back_actual
union all
select   'date_minus_2_expected' test_name ,   getdate() - 2   as date_minus_2_expected
union all
select  'date_minus_2_actual' test_name ,   getdate() - ?   as date_minus_2_actual

2. Created two parameters int32 - first one set to 4 second one set to 2 and mapped to above query

3. Created destination so I can make data flow works

4. Added dataviewer to see data

5. Executed

Result is shown below

test_name test_result
current_getdate 2016-03-03 17:33:55.083
date_minus_days_back_expected  2016-02-28 17:33:55.083
date_minus_days_back_actual 2016-03-01 17:33:55.083
date_minus_2_expected 2016-03-01 17:33:55.083
date_minus_2_actual 2016-03-03 17:33:55.083

As seen actual result is always 2 days bigger than expected - for instance when pass parameter int32=2  then actual result is exactly the same as current_getdate test result

Also as shown when you hardcode number inside the query it works as expected. So it must be something to do with parameters and maybe their types or the way it is interpreted while passing parameter. Any help is much appreciated

Thank you for your help


Viewing all 24688 articles
Browse latest View live


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