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

Is there an easier way: Entering Column Properties (fixed-width flat file connection manager)

$
0
0

Hello all,

 

I have all of my column properties (Column Name, Start POS, Length, Data Type, etc.) in an Excel spreadsheet/table/list.

 

It there any way to arrange/format this list so it can be used to easily create the columns rather than entering all this info manually?  Can it somehow be pasted into underlying XML?  Can column info be programmatically set (at design time...not run time) or connection manager be created programmatically using this list to designate columns?

 

My ADD/ADHD makes manually entering all the column info for many columns long/slow/tedious/painful.

 

Thanks for any help anyone can provide,

 

CTB


There is already an object named 'sysssislog' in the database

$
0
0

The information I’ve found on this issue is a couple of years old. I'm using SQL Server 2012. I have built a SSIS package that works perfectly until I turn Logging on. I’m logging to SQL Server which should create a log table called sysssislog under System Tables. However the table does not appear in Object Explorer, I can’t query the table, and I am getting error messages from the SSIS package. Based on a system table query I can see that the sysssislog object exist. I also see that is has an odd path associated with my company user name (e.g. DATABASE_NAME\Tables\INTERNAL%user123.sysssislog). All other (non-system) tables I’ve created appear with a dbo path (e.g. DATABASE_NAME\Tables\dbo.sysssislog).

I’ve also tried to re-create the table using the information found here:
http://www.roelvanlisdonk.nl/?p=581

However, I get a message saying the table already exists.

Can you please guide me in the right direction toward finding a solution?

--

Here is a subset of the error messages I received when I first turned on logging and ran my package:

This message appears once at the top:

Error: 0xC0202009 at Package1, Log provider "SSIS log provider for SQL Server": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37.

An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E37 Description: "Invalid object name 'sysssislog'.".

This message appears again and again:

Error: 0xC0202009 at Package1, Log provider "SSIS log provider for SQL Server": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14.

An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E14 Description: "There is already an object named 'sysssislog' in the database.".


package configuration of vaiable

$
0
0

hi

i am using package configuration of variable,but even if i change value its not taking that value.its taking value which i had when 

creating configuration file.

i set value properties of variable while creating configuration

FTP - and wildcard

$
0
0

Hi,

I have a simple package with an FTP container.

The FTP will send a file if I create a new connection manager with that exact file. Works and sends fine.

But..

I need to use a wildcard because the text file I am sending is created using a date. (20150205.txt)

So I go into the FTP container and I tell it to create a new variable. I create the variable with data type string and a value of C:\folder\folder\*.txt. I then run just the FTP and it fails.

Can't figure out how to get the FTP container to pickup my wildcard txt file.

The exact error is "Unable to send files using FTP connection manager"


qeqw

dtexec Version Problem

$
0
0

Hi everyone,

I created a simple SSIS Project in 2012 data tools, which had only a data flow, with one data source, one data conversion and one OLE DB Command.

I use the Excel source to pass the columns parameters to an SQL stored procedure.

When i execute the package inside Data tools it runs perfectly.

Mi problema is when i try to use dtexec, it generates the next error:

Package migration from versión 6 to versión 3 failed.

but i have other packages running nice with the same dtexec command.

In the Execute Package Utility, prompts this error:

To run an SSIS package outside of SQL Data Tools you must install OLE DB Command of Integration Services or higher.

Anny Suggestions?

Derived Column using Variable

$
0
0

Hi,

I have a requirement to derive month value from the variable.

The variable 'carInputMonth' holds the values 01 or 02 or 03 ...12 based on the input parameter.

My requirement is to load the target file with Month column and the value should be 'Jan', 'Feb',..'Dec'. So I have to derive the month name from month number.. I though to write a case statement in the derived column but it is not working for me. Please advise.

Thanks.

Script Task output in Chinese???

$
0
0

I added some error logging to my package and now my script task output looks like Chinese. This is not the error file I set up for the error logging but another text file that I was sending results too.  Next I took out the logging stuff and it still was not working right. So… I created a new project and imported my package into that and it is still spitting out what looks like Chinese. I looked at all the properties on each task and verified that the LocaleID is set to English (United States).  When I delete the text file I am send my data too and have it create while the package runs it comes out in English. It seems to work ok now but I am wondering why that happened in the first place and if this is something that will happen again when in production. What I can do to prevent it from happening again.

tks!


Reach for the unknown!

Finding out the dll reference behind an SSIS Toolbox Item in SSDT 2012

$
0
0

This might be a stupid question but I can't seem to figure out how to see what dll an SSIS toolbox item in SSDT 2012 is referencing. Is there someway to see this information? When I go to the Choose Toolbox Item Menu I don't see anything about SSIS so I'm assuming the option is strictly for the non-SSIS Toolbox. The reason i'm trying to figure this out is we have some add-ins on the computer I got for work and I want to know if these are new, native SSIS toolbox items or if they are by virtue of the add ins that were purchased.

Any assistance with this would be greatly appreciated.


Copy File name and Date only from a Folder with SSIS

$
0
0

Hello all,

I need to create a package which will list the file names and the dates in a folder, these files are blank flat files. After extracting the file names from the file path i need to create a table which will have two columns Filename and Date.We get about 1000 such files every month and we are looking to maintain them in a table.

Is this possible? Can someone point me in the right direction? 


FM

handling flat file destinations dynamically

$
0
0

After performing a join operation on two tables i get the below resultset

pid, fname, typename, pname, pcost

1, cad, bars, product-1, 100

2, har, witte, product-2, 120

3, nes, bars, product-3, 119

.....................................................

Now i need to create files with the obtained resultset like

Column 'fname' is the folder name and 'typename' should be the file in the particular folder.

For example the first record should be inserted into file name 'bars.txt' in the folder 'cad'

and third record should be created in file name 'bars.txt' in the folder 'nes'.

Could someone please help me with this?

SSIS SQL 2005 DTSGlobalVariables to .NET SQL 2012

$
0
0
 have the following code:

Function Main()

                'Declare variables

                Dim oPkg, oTextConn, oFSO

                Dim basepath, remotePath

                Dim filedate, importFilename

               

                'Create objects

                Set oPkg = DTSGlobalVariables.Parent

                Set oTextConn = oPkg.Connections("DataFile")

                Set oFSO = CreateObject("Scripting.FileSystemObject")

               

                'Config

                basepath   = "E:\TEST\"

                remotePath = "\\Server1"

               

                'Set the data filename based on yesterday's date

                filedate = DateAdd("d", -1, Now())

                importFilename = Right(Year(filedate), 2) & Right("00" & Month(filedate), 2) & Right("00" & Day(filedate), 2) & ".MRNG"

               

                'Set the datasources of the data file connections

                oTextConn.DataSource = basepath & "\data\" & importFilename

               

                'Get the import file

                oFSO.CopyFile remotePath & "\" & importFilename, basepath & "\data\"& importFilename

               

                'Cleanup

                Set oFSO = Nothing

                Set oTextConn = Nothing

                Set oPkg = Nothing

               

                Main = DTSTaskExecResult_Success

End Function

I am receiving errors in the 'Create Objects' section (DTSGlobalVariables.Parent).

How would I convert for SQLSERVER 2012 SSIS?

script task - 30 days back date in c#

$
0
0

hi

i am using c# in my script task.

i  need to function which gives me 30 days back date in c#.

 newTime = DateTime.Parse("2014-01-16");

instead of this had code i need something which gives me last month date

ex if today we have 2015-02-16 ,it should return 2015-11-16 ,basically last  month date


Merge join with sorted input is giving unpredicatable results

$
0
0

Hi there,

I have an interesting problem. I have two sources, both of which contain an SQL statement ordered on the ID on which I wish to join. I have set the "issorted" property on true and configured the "sortkey position" proportie (equals 1) on both sources.

The merge join is configured as an inner join on the sorted ID column which is an GUID. When running the data flow task the merge join component returns less rows then running the same statement in TSQL (using an inner join).

But, when I use the Sort component on both sources, the results are as expected.

I have absolutely no idea what the cause may be but it is very irritating because the Sort component is so slow that I have had to disable network optimizations due to "connection closed by host" messages (disable chimney).

More facts:
-Source 1 is Microsoft CRM 4.0 (SQL 2008 sp1 with last cum. update).
-Source 2 is Data warehouse (SQL 2008 sp1 with last cum. update).
-Source 1 contains 17 mil rows.
-Source 2 contains 17 mil rows (after initial load).
-I am using the merge join to only retrieve rows from the DWH (Source 2) which are retrieved from CRM (Source 1), which are restrictred by a "modified on date" check. During debugging my check is "select all rows from Source 1 where modifiedOn ISNULL(date,'1-1-3000')>= '1-1-1900'" thus returning all rows.

Things I tried which I am not happy with:
- Casting the GUIDS to nvarchar(36): performance down the drain
- Added an identity column to the base table in CRM, thus comparing INTs instead of GUIDS: Not supported so I rather not. 
- Added SORT component on OSurce 1 and 2: Current solution. Performance down the drain but since I am only retriving rows which are changed performace should be ok past the initial load phase

Any help is greatly appreciated!

Data Converson failed : returned status 4

$
0
0

I have a csv file as above . 

My table scheme is :

CREATE TABLE edw. [dbo].[fact_supplier_orders] ( 
[tender_no] [varchar](20) NULL 
[supplier_name] [varchar](20) NULL,
[contract_start_date] [datetime] NULL,
[contract_end_date] [datetime] NULL

when I am creating SSIS package : I am getting the following problem :

 Error: Data conversion failed. The data conversion for column "CONTRACT START DATE" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". 

How to convert the contract start date by using derived columns.

Export AD columns in SSIS

$
0
0

I know there are a lot of topics related to this: I know about setting up an ado.net connection. I just can't seem to put together statements to do this simple export which would enable to be to totally automate an ssis job I wrote: I want to get those two fields (ID and name) to export to a file. 


Thing I don't understand...variable in execute mail but the mail is blank

$
0
0

I got a simple package like this:

The execute as a simple select a,b from table1. I set the variable Tutto as object, as full result set. In the ForEachLoop I set the variable Tutto (ADO variable), first row...and the variables uno and due as index (0,1).

Script below (copy and paste practically, I am not good at C#)

        public void Main()
        {
            // TODO: Add your code here
            Variables varCollection = null;
            string message = string.Empty;
            Dts.VariableDispenser.LockForWrite("User::Message");
            Dts.VariableDispenser.LockForWrite("User::uno");
            Dts.VariableDispenser.LockForWrite("User::due");
            Dts.VariableDispenser.GetVariables(ref varCollection);
            //Format the query result with tab delimiters
            message = string.Format("{0}\t{1}\n",
                                        varCollection["User::uno"].Value,
                                        varCollection["User::due"].Value
                                      );
            varCollection["User::Message"].Value = varCollection["User::Message"].Value + message;
            Dts.TaskResult = (int)ScriptResults.Success;
        }
    }
}

And set the mail,

Everything it's ok, no error...everything green but there is no message in the mail that I receive. Totally blank. Why?

Thanks in advance

How do I loop through a data table in script task, in sets of 200?

$
0
0

 I have an object variable that I pass into a data table through a script task. It currently returns over half a million rows. I want to take those rows, and loop through the first 200, do some work, copy those to a new SQL table, get the next 200, do some work, copy them to the new table, get the next....

With the 200 records, I actually spilt them into a tab delimited string, which then gets sent to a third party app for verification. They send the records back with new fields appended. The 200 is a limit for the third party app. Here's what I have so far, but I just don't know where the (i) would go. I've tried different variations of "For each row(i) in dt.Rows", or "row(i)(col.Ordinal).ToString".

Am I going about this all wrong? Is there a better way that I just don't know of? All help would be appreciated!

 If (iStop >= mRecordCount) Then
            iStop = mRecordCount
        End If

        'initialize the address string
        strValue = "" 'Create string to pass through to CASS

        'build the address string
        For i = iStart To (iStop - 1)
            For Each row In dt.Rows
                For Each col In dt.Columns
                    strValue = strValue & row(col.Ordinal).ToString & mFieldDelimiter
                Next
                strValue = strValue.TrimEnd & mRecordDelimiter

            Next

        Next i


SSIS import from CSV file ADDS leading zeros to the SQL table. How to remove them?

$
0
0

Experts,

I have a CSV file that I need to load to a SQL table. Let's say, there's one column "ID" in the CSV file that has values like:

3871080510

3871080511

I have a ForEachLoop container and in my data flow task I am using a Flat File Source and connecting it to my OLEDB Destination. In the Advanced Editor in my source, I see the Output column "ID" as DT_STR datatype with Length 50.

In my destination table I have that column as VARCHAR(50) NULL.

When I run the package, the values in the column in my table are coming across as "003871080510" and "003871080511". I don't know why these EXTRA zeros are being added to the column. How can i remove them? Also, I need to make sure that if the value in CSV is like "01324354454", then I load it as "01324354454" only and NOT TRIM that leading zero.

Data Conversion

$
0
0

How to insert the date data in the database through SSIS Package .

start_date            end_date

01/08/2014         01/01/2015

01/10/2014    02/02/2015

Compressing an Excel file in SSIS

$
0
0

J have an SSIS procedure that creates an Excel spreadsheet of 70,000 rows and about 8 columns. The size is 3.5 meg which exceeds the attachment limit and prevents me from sending the spreadsheet as an attachment in my sendmail procedure.

Are there any properties in SSIS that would enable me to compress this file?

Viewing all 24688 articles
Browse latest View live


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