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

Is it Possible to write to excel using a script task without using Excel Interop Objects?

$
0
0

I have a limited working knowledge on SSIS, would appreciate if someone can advise on the query below.

I have a requirement to query data through stored procedures and extract them into txt, csv and excel formats. In the script task of the SSIS Package that i have, if the file extension is csv then the data is written using a comma delimiter and if the file extension is txt then data is written using a tab delimiter.

There's also excel. However, to write to excel the excel interop obejcts are used and very often (not always) i get the error something like "unable to load the interop dlls...". From what i understand, this is becuase the excel interop objects are not installed.

I would like to export the data to excel using a delimiter just like i do for csv/txt and without using the excel interop objects? Is it possible?


-- Praveen


Loading the data with XML Source having dataset element which contains a metadata element and a data element

$
0
0

It seems XML Source does not recongnize this type of xml, i found an alternative by preparing XLST file using XMLCompiledTransform in C#.NET , this is working 90% but it is very slow.

Do we have any other alternative to load these type of XML files.

Getting XML data of SSIS Package (which is located in File System) from a query

$
0
0

Hi,

We have around 200 SSIS packages deployed to File System. These pacakges are being scheduled using SQL Agent job.

So, currently I have a list of all the packages and their respective File Path.

Note : **They are NOT deployed to Server**.

Now, my task is to search all the packages which has a specific connection in it.

From the below blog, I got to know we can achieve this by querying the XML data of the SSIS Package.

https://www.simple-talk.com/sql/ssis/-exploring-ssis-architecture-and-execution-history-through-scripting/.

But in the above article they are getting the XML definition of the Package from msdb(as it was deployed to server).

In my requirement, SSIS Packages are in File System. Is there any way to to get the XML definition of these packages using a query.

Please let me know if the above requirement is not clear or if any further information is required.

Thanks


Raksha



IF date is in first 9 days then day is being converted to month and month into day

$
0
0

Hi,

I have a text file in which I have date created in british format i.e. '08/01/2014'. I have used derived columns to make sure the format of the date remains the same and using type cast converted to date

(DT_DBDATE) (SUBSTRING(VOUCHER_DATE,1,2) + "-" + SUBSTRING(VOUCHER_DATE,4,2) + "-" + SUBSTRING(VOUCHER_DATE,7,4)) 

so it should return the date in 08/01/2014 (dd/mm/yyyy) but it is converting it to 01/08/2014. It is converting only the dates less then 10. if date is 11 or 12 or 13 it is doing it fine like 12/01/2014.

Any idea why?


MH

using System::ErrorDescription in Insert statement

$
0
0

Hello,


I want to insert System::ErrorDescription to store the error in the customized log table. When I use the following statement, it does not insert anything. What am i doing wrong. Please advice.

create table dbo.load_err(load_err_id integer(PK),load_err_Dtl,loadtime)

INSERT INTO dbo.LOAD_ERR (LOAD_ERR_ID,
LOAD_ERR_DTL,
loadtime)
VALUES (NEXT VALUE FOR dbo.LOAD_ERR_SEQ,
 @[System::ErrorDescription] ,
getdate())

I see the row inserted but nothing in the Load_ERR_DTL column.


Error executing a stored procedure from SSIS using the MERGE statement between databases

$
0
0

Good morning,

I'm trying to execute from SSIS a stored procedure that compares the content of two tables on different databases in the same server and updates one of them. To perform this action, I've created a stored procedure in the destination database and I'm comparing the data between tables with the MERGE statement. When I execute the procedure on the destination database the error that I obtain is:

"Msg 916, Level 14, State 1, Procedure RefreshDestinationTable, Line 13

The server principal "XXXX" is not able to access the database "XXXX" under the current security context."

Some things to take in account:

1. I've created a temporary table on the same destination database to check if the problem was on the MERGE statement and it works fine.

2. I've created the procedure with the option "WITH EXECUTE AS DBO".

I've read that it can be a problem of permissions but I don't know if I'm executing the procedure from SSIS to which user/login I should give permissions and which.

Could you give me some tip to continue investigating how to solve the problem?

Thank you,

Virgilio

Output from script task to cmd prompt

$
0
0
Hi,

I have a SISS package that has script task in it. 

I'm exeuting the package in the command prompt using the following command. 

DTEXEC.EXE /F "C:\Documents and Settings\Devuser\Desktop\Deployment\Package.dtsx" /set \package.variables[filepath].Value;"C:\\Documents and Settings\\Devuser\\Desktop\\Release-Deployment\\release\\"

It is sucessfully executed and the following is displayed in the command prompt screen. 

DTExec : The package execution returned DTDER_SUCESS <0>

However, i would like to show cusom message. Is it possible to show custom message string returned by the script task? 

Please assist me. 

Thanks,
Venkat.

Best Regards, Venkat

ssis script component in vb how to read only last row of the file

$
0
0

Hi All

ssis script component in vb  how to read only last row of the file so that if the last id is less than lastest id then we will skip that file other wise we need to load required data.


Surendra Thota


Timestamp issue inn Flatfile

$
0
0

Hi All,

I am facing one serious issue with my flat file source data.

there is one column in flat file called descarge_date which come in  below format.

Jan20199712:00AM

and i am looking to convert it into DD/M/YYYY WITH Timestamp.

thanks in advance,

vipin jha


Thankx & regards, Vipin jha MCP

look is retrieving only one record

$
0
0

I’m trying pull data from prod server and dump it  into local server . below is  the package I created

In excel source. I’m placing a  record ID ..say  ‘a123-b456-789’ ( nvarchar)

Look up: it wil search  for the record ‘a123-b456-789’ in the table “ employee”

Destination:  is my local system.

empid

empname

account

a123-b456-789’

XYZ

RAM

a123-b456-789’

PQR

sun

a123-b456-789’

ABC

Rock

Issue  :  there are 10 rows in the employee table related the ida123-b456-789’ . but it is  getting only one record per execution .

Expected result : if there are 10 records then it should fetch 1o records and dump them into local system.


migrating Shared data sources

$
0
0
I've recently inhereted an SSIS 2008 project that uses shared data sources.  I need to migrate the entire solution to a new server.  What's the best way to migrate the data sources and all packages over to the new environment? Or should I take the time to switch over to configurations instead of .ds files?

John Schroeder

How to check whether the new records are inserted or not in SSIS

$
0
0

Hi All,

I have a SSIS package which insert data from Table A  to Table B . I need to insert only new records to Table B. If any record is not there it should insert the record if not ignore that record.

I used Lookup Transformation but it doesn't works from me, which tab should i need to select? Like in General tab we have  ignore failure, Fail Component,Redirect rows to no match output, Redirect rows to error output?

Please help me on this issue. 



Thanks, Shyam Reddy.

Questions About Script Task

$
0
0

I'm following the example here.

http://www.singhvikash.in/2013/05/ssis-how-to-loop-through-multiple-files.html

I think I have everything setup right, but something is not working here.  I followed all the steps, and for the scripting part, I did this:

Project > Add New Item > Class

I have a red squiggle lined under these two lines of code:

System.AddIn.AddIn

(int)ScriptResults.Success;

Here's an image.

I've done a bit of C# dev work, but not much really.  Also, I'm pretty new to SSIS.

Thanks, in advance, for the help.


Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

How to have a Dynamic CheckPoint File Folder or How to Pass the parent variable(vParCHKFolder) to the child variable (vChildCHKFolder ) using Package Configuration with Parent Variable ?

$
0
0

In my project, I am trying to have a dynamic checkpoint folder for each SSIS instance. But I found with the package configuration, parent variable, I cannot pass the value in mast package to child package to assign it to the variable for file path  in child package. 

This is my case:  1. I have parent package in which there is a Execute SQL task and Execute Package task.  In this parent package, there is string variable called vParCHKFolder, the Execute SQL task will assign a value to it according to what is saved in database, for example,  C:\CHK_Folder

2. Then there is another child package executed by the Execute Pkg task in Parent Package. I set up the Package Configurations with Parent Variable option, to assign the value vParCHKFolder to vChildCHKFolder. 

3. In the child package, I also have a variable called vChildCHKFileName assign with expression like @[System::PackageName] +".chk". the I set up the also CheckPointFileName of child package with expression  @[User::vChildCHKFolder]+"\\"+ @[User::vChildChkFileName]. I also did some other basic/normal setting for CheckPoint for Child Package.

Then the problem is:

When I run the project, I ran into the error: Checkpoint file "" failed during creation due to error 0x80070003 "The system cannot find the path specified.".  

After many tries, I find if I use Script task in parent package and directly assign a hard-coded value like C:\CHK_Folder to vParCHKFolder, then run the project, the child package can find the folder and it works well.

My question is why I have to hard code vParCHKFolder to do that, why the valued assigned by the sql task cannot be passed to child package with the configuration with Parent Variable?????? Thank you very much! Any thoughts will be appreciated. 


error exporting package from ssis

$
0
0

I'm trying to export packages out of SSIS to my local workstation, 'c' drive.    I have two different folders on the server, I'm able to export from one, but when I try to export from the other I get the following error.    Any ideas what I can do to get around this?

TITLE: Export Package - \MSDB\sub1\sub2\package_name
------------------------------

Exception from HRESULT: 0xC0010026 (Microsoft.SqlServer.DTSRuntimeWrap)

------------------------------
ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC0010026 (Microsoft.SqlServer.DTSRuntimeWrap)

------------------------------
BUTTONS:

OK
------------------------------


Extracting VarBinary(MAX) column to Flat File...

$
0
0

I’m extracting data from the table to flat file using SSIS,during this process I’m facing the data conversion issue in the varBinary(max) data column. To overcome this issue I have used Data Conversion in my data flow to convert to varBinary(max) to DT_NText but I’m getting the following error,

Error at Patient Documents Data Flow Task [Flat File Destination [1252]]: The data type for "input column 'MYCOLUMNNAME' (1355)" is DT_NTEXT, which is not supported with ANSI files. Use DT_TEXT instead and convert the data to DT_NTEXT using the data conversion component.
Error at Patient Documents Data Flow Task [SSIS.Pipeline]: "component "Flat File Destination" (1252)" failed validation and returned validation status "VS_ISBROKEN".
Error at Patient Documents Data Flow Task [SSIS.Pipeline]: One or more component failed validation.
Error at Patient Documents Data Flow Task: There were errors during task validation. (Microsoft.DataTransformationServices.VsIntegration)

So I have used TEXT type in data conversion but I'm not getting the Binary value "0x" is discarded,

DB Content = 0x3C436C696E69 (It's Part of the content)
After Data Conversion from VARBINARY(max) to Text "3C436C696E69" , "0x" is missing. Exactly I need to extract the varBinary data to flat file as it is like in DB.

Kindly Guide me where I'm doing wrong and help me out to overcome this issue.

Configure kerberos constraint delegation with sql 2012 and SSISDB

$
0
0

We try to configure constraint delegation with an sql server 2012 that have an SSISDB to host SSIS package.

If we configure kerberos to "trust to any services" we have no problem. The SSIS package start with the user identity and this identity is delegated to a database used by the package.

When we configure the sql instance to constraint delegation, we can test it with a db link to another server and the delegation work. But when try to test it by starting the same SSIS package that work in full trust, this doesn't work.

We can't figured out which SPN services to add to the service list of our sql instance user. We added all sql SPN associated with our different user but none have make delegation work for SSIS.

Is it possible to configure sql with constraint delegation and have delegation working with SSISDB (IsServerExec.exe)? If yes, which SPN we have to add?

Thanks,

Submit Form through C# Script To get File From Website

$
0
0
<form action="https://www.mywebsite.com/login" method="POST">

<label class="inline" for="remember"></label>

Hi I'm trying to download file from a url which is as below...

https://www.mywebsite.com/mydata/YYYYMMDD/balance_sheet.zip

But It requires a Login (codes are as given below). Is there a way in SSIS Script task that we can implement to Fill up this form and auto submit and get the file downloaded?

 <label class="inline" for="remember" style="font-size:0.75em;line-height:1.5;">User Login <input autocomplete="off" autofocus="autofocus" name="username" placeholder="User Login" tabindex="1" type="text" value="" />Password <input autocomplete="off" name="password" placeholder="Password" tabindex="2" type="password" /></label><label class="inline" for="remember" style="font-size:0.75em;line-height:1.5;"> </label><input alt="Login" name="login" tabindex="3" type="submit" value="Login" />

<form action="https://www.mywebsite.com/login" method="POST"><p><label class="inline" for="remember"><span></span></label></p><p></p><p><label class="inline" for="remember"><span>User Login</span><!--[endif]----><input autocomplete="off" autofocus="autofocus" name="username" placeholder="User Login" tabindex="1" type="text" value="" /><span>Password</span><!--[endif]----><input autocomplete="off" name="password" placeholder="Password" tabindex="2" type="password" /></label><!--[endif]----><label class="inline" for="remember"></label><input alt="Login" name="login" tabindex="3" type="submit" value="Login" /></p></form>
I tried below code, but it is stuck in Login Page, so basically it is downloading a File with HTML Source code of the Login Page (i.e. Login is getting stuck)

// Function Call

DownLoadFileByWebRequest("https://www.mywebsite.com/mydata/YYYYMMDD/balance_sheet.zip", "D:\\MYLOC\\balance_sheet.zip", "muusername", "mypassword");

//Function

private void DownLoadFileByWebRequest(string urlAddress, string filePath, string username, string password) { try { System.Net.HttpWebRequest request = null; System.Net.HttpWebResponse response = null; string credentials = username + ":" + password; request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(urlAddress); request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials))); request.PreAuthenticate = true; request.Timeout = 30000; response = (System.Net.HttpWebResponse)request.GetResponse(); Stream s = response.GetResponseStream(); if (File.Exists(filePath)) { File.Delete(filePath); } FileStream os = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write); byte[] buff = new byte[102400]; int c = 0; while ((c = s.Read(buff, 0, 1040)) > 0) { os.Write(buff, 0, c); os.Flush(); } os.Close(); s.Close(); } catch { return; } finally { } }


</form>

Regards, Avik M.

SSIS Capacity

$
0
0

Hello,

I wanted to create a SSIS package which will copy millions of data form sql table to sql table [SQL server edition] on a single attempt.

Could you please suggest me whether this SSIS package will handle this kind of load ? or

is SSIS is the best way to copy the millions of data data? or

is there any limitation for SSIS package to copy the data? 

Thank You

Does a simple Oracle Procedure to Flat File or a SQL database Exist ?

$
0
0

Hi

I looked around online for a while and it seemed to me that's there's no real simple solution to have a procedure sitting in oracle to produce an output into a sql table or a file.

the code executes correctly in a SQL task but unfortunately when I use an OLE DB Source in a Data Flow task it throws out an error.

there's no definitive answer online - would anyone know if there's a solution for this that wouldn't involve looping through a cursor and inserting records one by one to a file?

ORACLE ERROR


eddy.a

Viewing all 24688 articles
Browse latest View live


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