Quantcast
Channel: SQLServerCentral » SQL Server 2005 » SQL Server 2005 Integration Services » Latest topics
Viewing all 1193 articles
Browse latest View live

Rename File in SSIS

$
0
0
I need to rename a file in SSIS. Part of the file rename should include the current date.I am trying to use the File System Task, but I don't know how I can rename the file. The file name should look like the following: TimeCommUpdates[i]yyyymmdd[/i].xlsI'm thinking I may have to use expressions, but I can't find any good documentation on the subject.Any help would be appreciated.Thanks,Erin

SSIS, "Class Not Registered" error...deployment or permissions issue?

$
0
0
I'm getting an error with an SSIS package that reads from an Access DB on a network share and writes to the SQL Server (local to the SQL Agent). The error is long, but it basically seems to say:...MySSISPackage Connection manager "MyAccessDB.mdb".......SSIS Error Code DTS_E_OLEDBERROR........An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".However, the error only occurs when the SQL Agent attempts to run the package (i.e. when scheduled). No error when I run it from my local machine (package running with MY network credentials). I think this is a permissions issues with the SQL Agent that's running the SSIS package (it may not have read access to the MS Access DB). Still waiting for verification from the IT folks that the SQL Agent account has the correct permissions.On the other hand, I'm dealing with two dynamics that I'm not used to (not to mention that I'm still finding my way around SSIS) so I thought I'd ask about them here:1. In my environment, you cannot store/install SSIS packages on the SQL servers. To get around this, I've been storing the SSIS packages on a network file server share and pointing the SQL Agent to the share location. Does anyone else do this and if so, any problems?2. I haven't been "installing" the SSIS packages...just moving the object file around...from the "bin" folder of my SSIS project's directory (in the VS2005, "projects" folder), to the network share. Is this ok to do?

creating a package to import data from excel file into sqlserver table

$
0
0
Hi all,I am new to SSIS and i want to create a package which will upload data from 3 seperate excel files into the sqlserver table and then it should fire one update sql on it.PLease giude me the steps to do so.Thanks.

Conversion Fail-Potential Data Loss

$
0
0
Hi,I have a table with column [Date],data type varchar(50) in the format of 'mm/dd/yyyy'.This data is coming in from a txt file into a table(A) by the means of an existing SSIS package.I need to load Date records from table(A) to table(B).Table(B) spec is :-Columnname =DateDatatype=datetimeFormat/Style='mm/dd/yyyy'I have tried creating an SSIS package as below!Source(Table A) > Data conversion [DT_Date] >Destination(Table B)It fails with error [b]"[Data Conversion [1577]] Error: Data conversion failed while converting column "Date" (123) to column "Copy of Date" (1590). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.". [/b].Do let me know where I am going wrong ?Thank YOU !

How to Validate Data Coming into SSIS from Excel Spreadsheet?

$
0
0
I'm a newbie here with SSIS. I've worked extensively with multiple versions of SQL Server for about 20 years, but am working on a project that's using SSIS extensively.The project involves polling a specific folder once per day to determine if clients have uploaded files into this folder. If so, I've got coding in place thus far in SSIS that loops through each of these files in the folder. Next on my list is the required coding to process each of these incoming Excel files and ultimately get the structure of the files adjusted properly to where the meet the required schema for import into an underlying SQL Server database.Before I get into any of the data insertions from the Excel spreadsheets to the underlying SQL Server database, I'm researching exactly how to apply various "data validation" criteria to each Excel file to verify that the client has indeed sent me a "valid" Excel file that can legitimately be worked with in making any necessary transformations to the file to get it in the proper structure for import into a SQL Server database. I'm having problems determining exactly how/where this data validation will need to take place. I'm not even sure if "data validation" is even the right thing to call what I'm trying to do.I'm trying to figure out how to look at a few important columns within each Excel file and determine if the data within those columns is of a valid/expected format to even warrant dealing with the file, or if the file needs to be "failed" so we can send by to the customer for adjustment and resubmission to us.For example, if SSIS finds that the "SSN" (social security #) field unexpectedly has "Hello" in that column for one of the records instead of the expected 9-digit format for an individual's social security #, that's a big enough deal to warrant failing the file to not be dealt with in the import process. I'd like to have multiple data validation events occur simultaneously in addition to the SSN field example shown above. I might want to validate that all SSN entries contain 9 digits, as well as making sure that all entries in the "State" column contain a 2-letter state code, and also might want to verify that the format of the entries in the "ZipCode" field follow the standard 5-digit zip code format. If I find only 4-digits in a row's "ZipCode" field or I find "Chevrolet" in the "ZipCode" field for a record, or I find an issue with the "SSN" or "State" fields as described above, SSIS needs to somehow locate those issues to where I know to stop the file import process and flag things to send the file back to the client to correct those issues.I've researched Derived Columns and Script Tasks and other items and just can't seem to land upon a clear example / understanding of how to implement the initial data checks / validation efforts such as what I've described above.If anyone can clearly explain how to accomplish what I've described above or can point me in the direction of any online articles / tutorials that directly address how to accomplish this sort of thing, I'd be greatly appreciative.Thanks in advance!

SSIS will not start

$
0
0
I can't get SSIS server to start. Keep getting the error. "the request failed or the service did not start in a timely fashon." and this in the event log:Event Type: ErrorEvent Source: DCOMEvent Category: NoneEvent ID: 10005Date: 3/31/2010Time: 9:56:25 AMUser: N/AComputer: DECSQLP01Description:DCOM got error "The service did not respond to the start or control request in a timely fashion. " attempting to start the service MsDtsServer with arguments "" in order to run the server:{ABF05265-635E-44B0-A28F-AEA45247ACA0}For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.So far I can't find what this issue is.Running Win server 2003SQL 2005 Ent SP3 w/cumm update 3

AS400 to SQL 2005 very slow with SSIS and SP3

$
0
0
I have a series of SSIS packages that are transferring AS400 table structures to MS SQL2005. The SSIS package structures are very simple. 1) Ensure a table exists and create if necessary 2) Transfer AS400 data to SQL table 3) Index SQL table.The problem I have is that the transfer of data from the AS400 is painfully slow.This has been an ongoing issue with SSIS. However with SP3 the performance of our particular ETL went from poor to ridiculous.As an example in SP2 the entire ETL process took 25 minutes (transferring approximately 10 tables totalling around 750 MB).The day after the SQL Server was patched to SP3 the build time went to 16 hours! What! I have scoured the release notes for any relevant changes to SSIS and seen nothing that hints at changes that might cause this.It all comes down to the data transfer being terrible. There are no fancy transforms going on. The table structures were generated from the SSIS import wizard. The source on the AS400 are SQL tables not views.If anyone has any insight that would be great.

SSIS and Stored Procedure using RAISERROR and Output Params

$
0
0
I have a stored proc that has output variables containing an error message when a raiserror is raised. The stored proc also return a return code. The severity level of the RAISERROR is 16.When this is executed in Mgmt Studio, the stored proc fails as expected, but the output variables and the return code still return.When I use the execute sql task in SSIS, the task fails, but the output parameters and the return value never get populated.I can do a try...catch in the execute sql, but this just gives me the ERROR_MESSAGE() result, but I lose the return value and the other output variables.I don't mind the execute sql task failing once I get the return value and output parameters populated, but this is not the case. Does anyone know whether I can get the output parameters and return value to be returned when the execute task fails due to a RAISERROR event?

Strange issue while loading data from Excel using SSIS package

$
0
0
Hi All,I am running a SSIS package in SSK5 which loads data in some database tables from an excel file placed in a shared location.The excel has 8 columns each of which are mapped to an equivalent field in a table in the database. Needless to say the datatypes of the fields are also similar.Some of the columns in the excel are of datatype datetime, decimal (18,10) and int. I have attached a sample excel for reference.The excel always does not have values for every field except the File# field which is the primary key in the database.When I load the data into the database by running the SSIS package, I observe a strange behavior -1) Scenario 1 - When the 1st row of the excel does not have any value for the fields Contract Start Date,Contract End Date,Ads Contracted & Rate, none of the data for these columns for the rest of the rows of the excel are populated into the database.2) Scenario 2 - When the 1st row of the excel has some data for the fields Contract Start Date,Contract End Date,Ads Contracted & Rate, all the data in the excel for all the rows are populated in the database.The datatype for Contract Start Date & COntract End Date are Datetime, Ads Contracted is int and Rate is Decimal (18,10).I have tried loading the data using -A) A SQL task where I run a query INSERT INTO [DBTable] (FieldList)SELECT * FROM OPENDATASOURCE ('Microsoft.Jet.OleDB.4.0', 'Data Source=E:\Test\dataLoad.xls; extended Properties=Excel 8.0') WHERE [FILE #] is not nullB) By using data flow task where I use an Excel SOurce and OLEDB Destination. I am observing this strange behavior in both the occasions.This issue has left me at wits end and I dont see any logic behind it.ANY HELP IN THIS REGARD WILL BE HIGHLY APPRECIATED.Cheers,Sumon

SSIS Package not failing?

$
0
0
Hello -My SQL Server Agent shows successful completion of SSIS job but messages in Log File view shows that there was an error. How can I get the Agent to fail if there was an error or a failed to execute in the SSIS package?See attached pic for what I am seeing.Thank you,David

SSIS 2005: How to Dynamically Rename First Worksheet in Various Excel Files

$
0
0
Here's my situation...I'm working on a project for a client (I'm a newbie SSIS user, but have about 20 yrs. of SQL Server experience... just not with SSIS until now) and I'll be looping through various client files (Excel files) that they receive via a Sharefile location. The Sharefile location syncs automatically down to the client's local desktop.I've implemented some test code thus far that loops through each client's Excel files and moves them initially out of the original location and into another folder location to indicate that the files are ready to be processed. The filenames of each client's exported file are random and can change from export to export each week/month, and the names of the first worksheet (there's only one worksheet in each Excel file) can be random from export to export each week/month as well.What I'd like to do is to:(1) Move all of the files that are found within the specified folders to a new location as indicated above to indicate that files have been received and they're ready to be processed (this file movement portion is already in place and accounts just fine for the random file names from each client's exported Excel files).(2) *** Here's the piece I'm trying to figure out ***... I can either loop through the now-moved Excel files and find each file's first worksheet and rename each file's first worksheet to something constant and save each file before I continue on with the remaining work, or I can just allow for the sheets to all be named differently in the now-moved Excel files and deal with retrieving data from randomly-named sheets on the fly as I loop through each Excel file.It would seem to be easiest within SSIS if I could setup some sort of task (not sure if I'm calling "task" by the right name or if it's technically something else I'm trying to do) to loop back through the newly-moved files once they're all out of the original Sharefile location to the new location and rename each file's first worksheet to something standard. So let's say a file from a client is called "ABCCompany.xls" and they've randomly named their only worksheet within the file to "PayrollInfo". I could have the SSIS package code find that first worksheet and rename it to "Sheet1" and save the edited Excel file. Then the continued loop through the folders would possibly find another file, and we'll say it's named "XYZPayroll" with its first and only worksheet randomly named "Info", and the SSIS code would automatically rename the "Info" worksheet again to my standard name of "Sheet1" and so on for each file.That way going forward, I'd at least know that as I looped through the randomly-named Excel files to do stuff to the data in them, the 1st worksheet (and actually the only worksheet present in each file) would be named consistently as "Sheet1".Any suggestions / examples / links anyone can provide on how to do this would be greatly appreciated.

Derived Column Transformation not filtering as expected in SSIS 2008 Data Flow

$
0
0
Hi All,I have the following Expression working on a Derived Column in an SSIS Data Flow Transformation[quote][Date_Start] == " 0 0- 0- 0" ? NULL(DT_WSTR,10) : SUBSTRING([Date_Start],5,4) + "-" + SUBSTRING([Date_Start],3,2) + "-" + SUBSTRING([Date_Start],1,2)[/quote]However [quote]0 0- 0- 0[/quote] values are not being replaced with NULLs by this expression.I have been trying to resolve this for the best part of a day so at this point any suggestions/advice would be appreciated...Thanks

DTEXEC returning Exit Code 5

$
0
0
I have a simple SSIS package that retrieves data from a formatted Excel spreadsheet. The Stored Procedure has the appropriate permissions and executes correctly. xp_cmdshell is active and the user group has execute permissions. The spreadsheet source location has the permissions set. I am the originator of the package and it works correctly for me on any desktop in the domain. When another user tries to execute the SSIS package, the package exit code of 5 (The utility was unable to load the requested package. The package could not be loaded.) comes back. msdb roles for db_ssisoperator, db_ssisadmin, and db_ssisltduser have been assigned to the user group. What permission am I missing? This is getting frustrating.Thanks in advanceScott

Can Package Be Run From Client Machine? Will Connect To Separate SQL Server Machine.

$
0
0
In a few months I will be installing a SQL Server package at a client's office. I've been doing SQL Server work for 20 years but this is a new thing for me as far as doing SSIS work, so I'm feeling my way around here and thinking ahead for how this will all need to work once I get everything installed at project completion. The main user likely has SQL Server Management Studio installed on his desktop PC, but the actual SQL Server installation is on a separate machine. I'll have a job setup that will be scheduled to run automatically each evening at 7 p.m. to kick off the SSIS package. The package will basically search for new Excel files that have been placed out in a specific folder, move those files to a different folder to get them ready for processing, then the data in those files will be moved into SQL Server. Seems to complicate things though with the fact that the files that SSIS will be searching for will reside in a folder on the one individual's desktop PC, as they are automatically synchronized down from a Sharefile location online. I'm curious how the job that will run on the SQL Server will access the files that reside on the one guy's desktop PC that's separate from the machine running SQL Server and move the files to another location on the one guy's machine. This may all be simple but I'm having trouble processing the need for interaction between the Excel files on the guy's machine and the SSIS job that will reside on the separate SQL Server machine and the fact that the SSIS job will be needing to read/write to files on the separate machine. Thanks for anything that can be communicated to me to clarify my thoughts here.

How to Tell If At Least 1 File Exists in A Collection of Subfolders

$
0
0
This seems very simple but I'm drawing a blank...I want start up an SSIS 2005 package and first check a collection of subfolders within a main folder to see if any clients have uploaded any files into any of these subfolders. I don't initially care about any file names. I just want to know if within several subfolders within a main folder if there is at least 1 file present. If there's at least 1 file present, then I want to move forward with the ETL process specified in my package.I have this so far and there are tons of files within the subfolders contained within my main folder here but the fi.Length is constantly returning 0.[code] Public Sub Main() Dim sSourceFolder As String sSourceFolder = Dts.Variables("SourceFolder").Value.ToString Dim di As DirectoryInfo = New DirectoryInfo(sSourceFolder) Dim fi As FileInfo() = di.GetFiles("*.*") If fi.Length > 0 Then Dts.Variables("User::isFileExists").Value = True Else Dts.Variables("User::isFileExists").Value = False End If Dts.TaskResult = Dts.Results.Success End Sub[/code]Any suggestions where I'm going wrong here?

SSIS Task to Tell if Any Files Exist in Any Subfolder Within a Root Folder?

$
0
0
Seems extremely simple but I'm not getting anywhere.I have a folder that clients can drop files into from day to day. The main/root folder is, for example, "c:\ClientFiles\".The subfolders can change from time to time but they're something like:- c:\ClientFiles\ABCCompany\- c:\ClientFiles\XYZCompany\- and so on...The client files that can be dropped in these randomly-named subfolders also don't follow any consistent naming pattern.What I'd like to do is to write some sort of SSIS Script Task that loops through the subfolders within the "c:\ClientFiles\" root folder and verifies that at least *ONE* file is found somewhere in one of those subfolders. It doesn't matter if just one file is found or 10,000 files are found... basically if at least 1 randomly-named files is found in any of the randomly-named subfolders within the root folder of "c:\ClientFiles\", then that's an indication that at least 1 client file has been uploaded into this directory since the last time the SSIS package ran and it's therefore o.k. to run this package once again.If there are no files at all found in at least 1 sub-folder, then the package doesn't need to continue running.Anyone have any sample code or suggestions as to how to perform this seemingly simple file / folder / subfolder search?Thanks.

Variable As OLE DB Connection.

$
0
0
Hi Guys, Need Help,I want to know what is the best way to deal this kinda Problem or approach. I am creating almost 30 SSIS Packages, some of them or simple and some of them are really tough (SCD and Other Transformations), First I am gonna run SSIS Packages on Test Server then Dev Server and then Finally Production. Its to much for me to every time change OLE DB Connection, and recreate SCD mapping and everything. I want to know If I can use OLEDB Connection as a VARIABLE, Instead of change all OLEDB Connection, just change one VARIABLE. If I create Variable as a CONNECTIONString, I am having a error something like " It must consist of one or more components of theform X = Y, separated by semicolons."Any Help would be great appreciate or any other easy solution. Thank You.

SSIS Package run based on variable

$
0
0
[img]H:\adalal\package.bmp[/img]As you can see in the picture attached I am trying to execute the second level of the package ie T1A, T1B,T1C and T1D based on the variable hour .... like i want to run this package at 11am, 2pm, 3pm and 7pm and based on that the package should run T1A or T1B or T1C or T1D ....Can you please let me know if my setup is correct or not because the package does not run after second layer i.e the date flow task 3 of package does not run ... execute sql works fine and T1B works fine .... if i remove the connection between T1C AND DATAFLOW then it works fine but when i have two or more connections it doesnot work ...FYI .....I have attched the image named package.bmp with this postPlease help me find the issue .... Regards

SSIS Interview Question and Answers

$
0
0
hi,Please provide me the information regaring SSIS Interview Question and Answers. I am preparing for it.regards,Deepak

Unable to Send Files to FTP Server

$
0
0
Hi, Sorry if the topic already exists.I want to process an excel report and send the file to FTP server. I can receive file from the FTP server but unable to send it to it. But I can copy & paste the file to the location, so I think there is no permission issue.After execution, I get the following error as=======================================================================[Connection manager "{E48D978F-8F62-42B6-9F06-DE3DD7444A5D}"] Error: An error occurred in the requested FTP operation. Detailed error description: 200 Switching to Binary mode. 200 PORT command successful. Consider using PASV. 553 Could not create file. . ========================================================================I just cant understand the error and its root cause.I use the following code in Script Task---------------------------------------------------------------------------------------------Try Dim cm As ConnectionManager = Dts.Connections.Add("FTP") cm.Properties("ServerName").SetValue(cm, Dts.Variables("ftpServerName").Value.ToString) cm.Properties("ServerUserName").SetValue(cm, Dts.Variables("ftpUserName").Value.ToString) cm.Properties("ServerPassword").SetValue(cm, Dts.Variables("ftpPassword").Value.ToString) cm.Properties("ServerPort").SetValue(cm, "21") cm.Properties("Timeout").SetValue(cm, "0") 'The 0 setting will make it not timeout cm.Properties("ChunkSize").SetValue(cm, "1000") '1000 kb cm.Properties("Retries").SetValue(cm, "1") Dim ftp As FtpClientConnection = New FtpClientConnection(cm.AcquireConnection(Nothing)) ftp.Connect() Dim files(0) As String files(0) = "C:\MTOrders.xls" ftp.SendFiles(files, "//MTOrders.xls", True, False) ftp.Close() Catch ex As Exception Dts.TaskResult = Dts.Results.Failure End Try------------------------------------------------------------------------------------------------Please help me in solving this issue.Thanks in advance.Priya
Viewing all 1193 articles
Browse latest View live