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

Calling Oracle procedure from Execute sql task

$
0
0

Hio Garus,

I have been trying to call oracle procedure from EXECUTE SQL Task but no luck,

Oracle procedure accept input parameters and its return couple of out  variables.

Procedure format is here.

   college.information

     (id                     IN  VARCHAR2,

     date                   IN  DATE     DEFAULT SYSDATE,

     class                      IN  VARCHAR2 DEFAULT NULL,

      report       OUT  VARCHAR2,

     status                                  OUT  NUMBER,

      message                             OUT  VARCHAR2

     )

Could you please help me here by providing solution for accepting input parameters and return values.


Loading Excel data to SQL server error on Date columns

$
0
0

Hello Folks -

I have Excel file importing to Sql server table. But the SSIS package fails with the following error

I have Closed Date column in Excel Data coming as 12/20/2019 but looks like the sql server table format closed date format is date time.

HOw can i add a solution so that i add the time part to the exisiting excel data and load or any simple solution anyone know?

Error 0xc02020c5: Data Flow Task 1: Data conversion failed while converting column "ClosedDate" (36) to column "ClosedDate" (281).  The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

Derived column expression help

$
0
0
Hi all,

I want to extract specific portion from file Name

Please help me with Derived Component Expression

For Example :

My file Names are :

201701_Purchase_Maruti_Actual_China_Sales Flash.xlsx
201702_Purchase_Maruti_Actual_India_Sales Flash.xlsx
201702_Sales_Maruti_Actual_GI_ABC Flash.xlsx   

Ans : 

China
India
ABC

Enable the Outlook Security properties while sending a Mail using Send Mail Task

$
0
0

Hi Guys,

Is it Possible to send an Email by enabling the Outlook Security feature of Restricted|Do Not Forward, If we are using the Send Email Task?

Is there Any property that we need to configure the Security Feature.

Thank YOU

Wrong code page when executing package on server, but correct in Visual Studio

$
0
0

Hi

I have an ssis packge that loads hard coded strings into a table in a data flow task. The columns of the table are all nvarchar, and the text that is loaded contains the Swedish special letters: "Å Ä Ö". When I check the meta data inside the data flow task, the columns have the data type "DT_WSTR"

When the package is executed from inside Visual studio, all is fine and the text in the table is exactly as it should be.

However

WHen I deploy the very same package to the same server as Visual Studio executed against, and execute it on the server by right clicking on the package, the text that is loaded to the same table is not correct.

Instead of this:

"Ack första halvåret t.o.m. april"

I get this

"Ack första halvåret t.o.m. april"

How can this be?

It seems to me like there is a property on the server that somehow change the codepage?

I dont know if it matters but the default collation of the server is SQL_Latin1_General_CP1_CI_AS, and that is also the collation of the database.

RunGuid Value upto 23 digits in derived Column

$
0
0
Hi everyone I want to insert GuidId in my target table . It has the value upto 23 digits without any special chars in it. Ex: 20200106115423786445113. I got an expressionLEFT(REPLACE(REPLACE(REPLACE((DT_STR,30,1252)GETDATE(),"-",""),":",""),"",""),14) this expression gives me the value up to 14 digits but I want upto 23 digits. I am struck here couldn't find any solution. please help me. TIA

Training Institutes for SSIS, SSRS in Hyderabad

$
0
0

Hi,

I am seeking for good training institutes for taking training in SSIS, SSRS in Hyderabad. Anyone with knowledge reagrding it please suggest.

Thank you.

Merge PDF files into one file

$
0
0
Is there a way in SSIS where we can merge multiple PDF files into one PDF file? Not sure if this is achievable using SSIS. Let me know if not using SSIS what are the other ways to achieve this? Any help much appreciated.

Cancel/delete execution with status of "Created Execution"

$
0
0

I have a couple of executions with a status of "Created execution".  I can see this either via the Executions report or query (SELECT * from catalog.executions where status = 1).

How can I get rid of these executions without calling catalog.start_execution?  We do not want these to run, but I want to clean them up so they do not show up anymore.

Jobs can get in this state for a couple of reasons:

  • start_execution called when SSIS is down
  • required parameters not set on job
  • start_execution never called

Thanks.


Replace cells values by an another one

$
0
0

Hello the Expert, 

I need your help.
I have a column like this

I have to return in another column a value corresponding to the value of column A
Example if column A contains CPS, then put in column B CBC Production Series
But as you see some cell contain more than one value CPS - IF
And in this case, I would like for this line 2 records one for CPS (CBC Production Series) and another for Inconnu Format.
Can you help me ?

Thank you 

scripted data source that uses sql reader seems to abort on same # records

$
0
0

Hi, I'm running vs 2017.  sql 2017 std.

Long story but because my query is over 20k bytes long, I resorted to mapping it to a variable of type ado object and attempted to run it in the scripted data source you see below.  I switched to a multi row result set in that var mapping even though there is only one command.  In 2 out of 3 tests on different location data, the script still went down on the 29,748th record.  I do not believe nulls are any longer an  issue.

The exception is shown below.  I am running in debug under vs.   Run 64 Bit Runtime is true in both the active (development) and development debugging config properties under project->properties->debugging.  In the data flow where this component is the data source, the defaultbuffermaxrows is 10,000 and the defaultbuffersize is 10,485,760.  Engine threads is 10.  The server has 32 gig of ram.

Does anybody know of some limit that might be biting me here?  Or maybe a limitation when debugging?  I noticed the x(86) path somewhere as I was perusing, I think it was an assembly path.

"System.Runtime.InteropServices.COMException (0xC0047020): Exception from HRESULT: 0xC0047020\r\n   at Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSBuffer100.AddRow(IntPtr ppRowStart)\r\n   at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.AddRow()\r\n   at Microsoft.SqlServer.Dts.Pipeline.ScriptBuffer.AddRow()\r\n   at MyOutputBuffer.AddRow() in C:\\Users\\myid\\AppData\\Local\\Temp\\9\\vsta\\longstringofnumbersandletters\\BufferWrapper.cs:line 353\r\n   at ScriptMain.CreateNewOutputRows() in C:\\Users\\myid\\AppData\\Local\\Temp\\9\\vsta\\longstringofnumbersandletters\\main.cs:line 118" string

using System;
using System.Data;
using System.Data.OleDb;
//using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System.Data.SqlClient;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
    IDTSConnectionManager100 connMgr;
    SqlConnection sqlConn;
    SqlDataReader sqlReader;
    public override void AcquireConnections(object Transaction)
    {
        connMgr = this.Connections.ADO;
        sqlConn = (SqlConnection)connMgr.AcquireConnection(null);
    }
    public override void PreExecute()
    {
        //these 5 lines retrieve the 20k byte query command
        OleDbDataAdapter da = new OleDbDataAdapter();
        DataTable dt = new DataTable();
        da.Fill(dt, Variables.extractCommand);
        DataRow dr = dt.Rows[0];
        string a = dr["command"].ToString();
        SqlCommand cmd = new SqlCommand(a, sqlConn);
        sqlReader = cmd.ExecuteReader();

    }
    public override void CreateNewOutputRows()
    {
        while (sqlReader.Read())
        {
                try
                {
MyOutputBuffer.AddRow();
MyOutputBuffer.locCode = sqlReader.GetString(0);
MyOutputBuffer.ID = sqlReader.GetInt64(1);
if (!sqlReader.IsDBNull(2)) { MyOutputBuffer.a = sqlReader.GetInt32(2); }
if (!sqlReader.IsDBNull(3)) { MyOutputBuffer.b = sqlReader.GetBoolean(3); }
if (!sqlReader.IsDBNull(4)) { MyOutputBuffer.c = sqlReader.GetInt32(4); }
MyOutputBuffer.d = sqlReader.GetInt32(5);
MyOutputBuffer.e = sqlReader.GetDateTime(6);
if (!sqlReader.IsDBNull(7)) { MyOutputBuffer.f = sqlReader.GetInt32(7); }
if (!sqlReader.IsDBNull(8)) { MyOutputBuffer.g = sqlReader.GetByte(8); }
if (!sqlReader.IsDBNull(9)) { MyOutputBuffer.h = sqlReader.GetString(9); }
MyOutputBuffer.i = sqlReader.GetDateTime(10);
if (!sqlReader.IsDBNull(11)) { MyOutputBuffer.j = sqlReader.GetInt32(11); }
if (!sqlReader.IsDBNull(12)) { MyOutputBuffer.k = sqlReader.GetInt32(12); }
MyOutputBuffer.l = sqlReader.GetInt32(13);
                }
                }
                catch (Exception ex)
                {
                    //I caught and copied the exception here in debug
                }
          
    }

   
    public override void PostExecute()
    {

        sqlReader.Close();
    }

    
    public override void ReleaseConnections()
    {

        connMgr.ReleaseConnection(sqlConn);

    }

}

Stopping a Data Flow Task quickly when Excel source columns aren't correct?

$
0
0

I have a Data Flow Task consisting of a source Script Component that reads an Excel file.  That data is fed into a transformation Script Component that verifies the columns are correct and reorders and assigns them to the destination columns.  Then the data runs through a conversion task.  Then to the destination component.

When the transformation Script Component looks at the first row and detects an invalid file, I want to abort the whole process.

The problem is it always takes just as long to return immediately from Input0_ProcessInputRow() as it does to import a valid file.  Nothing I do speeds up the process of exiting the execution of a package.  Even throwing an exception as the first statement of Input0_ProcessInputRow() doesn't speed it up.

What can I do to make error feedback faster?

convert ANSI to unicode

$
0
0

Hi,

I am trying to convert while uploading a text file from ANSI format text file  to Unicode format text file.
How can I do it in Classical ASP.

I mean by default the format of text file is ANSI. And when I select this file and trying to upload it in to server then I need to convert this text file format from ANSI to UNICODE.

Means once the file is uploaded from my local PC to sever then the uploaded file on the server must be in UNICODE format.

How can I do this one? Please help me!

Regards
Shaji



Split the file

$
0
0

my ssis package downloades the text file from Ftp. iT downloades for ex 5 files.

I want to split the file to smaller file after downloades. If the size of file is more then 600 mB then I want to split it into 6 files.

please suggest if any task in SSIS can perform this or any other way.

 

I need to change the extension of all the files in folder where extention is '.TXT' to '.DAT' using SSIS VB script task.

$
0
0

Hi All,

I have come across the requirement where I have multiple files in Folder with different extentions. I need to change the extension only for those files who has the '.TXT' extension to '.DAT' file.
How can we achieve this using SSIS VB script task. I have already done this with File system task But I have asked to do this with only SSIS VB script task.

Could anyone share how can we do this?

Thanks in advance.


script to get recent file in past 30 days C#Script

$
0
0

HI 

I  have a date i can pass . i need c# script to look in a folder directory for a file  that is  below that date in the past 30 days . if its more that 30 days  generate a warning and  continue  with execution (get the File name ) . if its more than 180 days generate a error  and  stop processing 

 here we cannot use the last  modified date from the file system. the date will be on the file name like 

abc_xyz_20200106.rml

I need to change the extension of all the files in folder where extention is '.TXT' to '.DAT' using SSIS VB script task.

$
0
0

Hi All,

I have come across the requirement where I have multiple files in Folder with different extentions. I need to change the extension only for those files who has the '.TXT' extension to '.DAT' file.
How can we achieve this using SSIS VB script task. I have already done this with File system task But I have asked to do this with only SSIS VB script task.

Could anyone share how can we do this?

Thanks in advance

Can I use a package event to exit the package immediately?

$
0
0
I'm reading about and trying to understand event raising and handling.  Can I raise an event or handle an event to exit the package execution immediately?

Where to find the logging?

$
0
0
I have add ssis logging in SSIS package.
Provider type: SSIS log provider for SQL Server.
Where to find the logging?

Restore SQL 2005 dbs to 2008

$
0
0
Hello all,

I had a system running SQL server 2005, after a crash i needed to build the server from scratch and i got MS SQL 2008 installed, i restored all databases from a backup all attached well to SQL 2008 except, master db, i need to restore it to restore the users logins and db settings, when i tried to do so from sqlcmd i got this error:

"The media family on device ... is incorrectly formed"

any advise ? thanks.
Viewing all 24688 articles
Browse latest View live


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