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

Flexible File Destination filename from variable

$
0
0

Hi All,

I'm using Flexible File Destination to insert records to Data Lake Gen2 files, my question is how can i pass variable to the filename property?

Everyday running the package, it created file with today name "20191212.txt", "20191213", "20191214",... ?

Thanks,

Mo Ghaffar



Regards, Mohamed Abdel Ghaffar | http://sharepointfoundation2010.blogspot.com


Obfuscate database connection password in SSISDB

$
0
0


I have an SSIS package (Project Deployment Model) in VS 2017. I can deploy it to SQL Server 2016 and can execute it. My package pulls data from Teradata and imports it into SQL Server. When I rt-click on the package in SSISDB, select Configure in the popup menu, then click the Connection Managers tab, I can see the password for my Teradata connection. My DBA is requiring me to hide this password so that it displays asterisks (or is not readable to the human eye) in place of the actual password. I have searched the web for quite some time but I cannot find any useful information that will help me hide my password. Would somebody be able to help me understand how to prevent a password from being viewed in SSISDB? Thanks!




Kevin Lowery


How do you deploy a Visual Basic program with a database

$
0
0

I am at a point in the project where I want to publish the project together with the database.

I want to supply it to the user on a CD with the database, but I don't know how to add the database files to the database.

Using publish I get it to install SQL Server locally, but then I'm stuck, as I don't how to transfer all of the tables to the database without user intervention.

I have been using a tutorial on SSIS but I am not sure of the steps I need to take to tranfer the data.

Has anyone any examples and a list of steps I need to do to acheive this?

I would be gratefull for any help!


TEH

SSIS project deployment on Azure Data Factory Pipeline with SSH.NET SFTP library DLL.

$
0
0

Hi Friends,

I am using SSH.NET library inside my SSIS project Script Task stages on Visual Studio 2017 IDE using SSDT tools. The project is running well on my local laptop and I am able to connect on SFTP folders. 
But when I am deploying this SSIS package on Azure Data Factory Pipeline. It is throwing assembly reference error like below.

Error: Could not load file or assembly 'Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106' or one of its dependencies. The system cannot find the file specified.\n12/17/2019 12:58:22 PM +00:00 : Failed:Error: The script returned a failure result.\n",

Please help me in solving this SSIS and Azure Data Factory third party DLL issue.

Thanks in Advance.

Abhishek

Loading multiple tables from informix to Sql server

$
0
0

Hello All, 

What would be the best way to load 500+ tables from Informix to SQL Server. The destination tables will have to be either created during the process dynamically or created upfront using the informix meta data information. Is BIML an option?

Thanks

Copy File from Azure Storage Fileshare to FTP

$
0
0

Hello

What is the best approach to copy a file from a Azure Storage fileshare to an externa FTP server?

Right now I can think of the following approaches:

  • Use Script Task: I am assuming there are .NET libraries which help achieve this, please correct me if this assumption is incorrect. The drawback of this approach is because of maintenance and custom C# codes which lots of people are uncomfortable with.
  • Use Third-Party Component: Again, I haven't done enough research about this as I started working on the problem just today, so I am not sure if there exists any such component. But this will incur additional costs and involves trusting the third-party with their privacy policies.
  • Use Logic Apps: This is possibly the most straightforward way to achieve what I need but this is another addition to our Azure infrastructure. I am not entertaining this as I don't have the permissions right now to do this, but I will probably take use this implement what I need.

Is there any other way to achieve this that I am unaware of? I can also utilize ADF but it seems a lot more limited than the SSIS itself.

Thank you


Sohi

How to use Recordset as a Source in Flat file Destination?

$
0
0
Hello Everyone,

I have two types of flat files 
1. Type 1
2. Type 2

I need to iterate each record of Type 1 and perform some operations on some of Type 2 files based on some filter condition. 

For that, I am using Data Flow for Type 2 files and  storing the result in record-set. 
And I am using that Record set Object in Script Component and then added output of all Type 2 columns.
The above solution is working fine, but the performance is not good because in each time it will read the Record set and then create output rows for each iteration of Type 1 record.

Is there any other way to do the same?

SSDT 2017 crashing with error

$
0
0

I'm getting this error stack when trying to use SSDT 2017 15.9.2

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

Failed to create the task. (Microsoft Visual Studio)

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

Could not load file or assembly 'Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (Microsoft.SqlServer.ManagedDTS)

------------------------------
Program Location:

   at Microsoft.ApplicationInsights.Extensibility.Implementation.Platform.PlatformImplementation..ctor()
   at Microsoft.ApplicationInsights.Extensibility.Implementation.Platform.PlatformSingleton.get_Current()
   at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.Initialize(TelemetryConfiguration configuration, TelemetryModules modules)
   at Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.get_Active()
   at CozyRoc.SqlServer.SSIS.Telemetry.#=z$lEq4oMyuHmq()
   at CozyRoc.SqlServer.SSIS.Telemetry.#=zKNOXzm2tmY6F24iQOA==()
   at CozyRoc.SqlServer.SSIS.Telemetry.TrackEvent(String eventName, IDictionary`2 properties, IDictionary`2 metrics)
   at CozyRoc.SqlServer.SSIS.TaskHelper.TrackInitialize()
   at CozyRoc.SqlServer.SSIS.ExcelTask.InitializeTask(Connections connections, VariableDispenser variableDispenser, IDTSInfoEvents events, IDTSLogging log, EventInfos eventInfos, LogEntryInfos logEntryInfos, ObjectReferenceTracker refTracker)
   at Microsoft.SqlServer.Dts.Runtime.ManagedWrapper.InitializeTask(IDTSConnections100 connections, IDTSVariableDispenser100 variableDispenser, IDTSInfoEvents100 events, IDTSLogging100 log, IDTSEventInfos100 eventInfos, IDTSLogEntryInfos100 logEntryInfos, IDTSObjectReferenceTracker100 refTracker)
   at Microsoft.SqlServer.Dts.Runtime.Executables.Add(String moniker)
   at Microsoft.DataTransformationServices.Design.DtsBasePackageDesigner.CreateExecutable(String moniker, IDTSSequence container, String name)


Power Query Source - Visual Studio 2019

$
0
0

Hi All,

I looked at this connector back in March of 2019.  I was able to run a data flow from the development environment without any issues.

Roll forward six months, I am having issues getting this sample to work again.  I went back to a very simple Virtual Machine build of Windows 10 and Visual Studio.  Enabling the Azure features shows the PQS.  However, when I run the flow in debug mode, I get the following error below.

The M-Language query comes from a working Power BI example report and both connection managers test successfully.

In short, there seems to be an issue with the current bits for this component and VS 2019.

Sincerely

John

TITLE: Package Validation Error
------------------------------

Package Validation Error

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

Error at DF_GRAB_SUPERBOWL_TEAMS [SSIS.Pipeline]: The "PQS_SUPERBOWL_TEAMS.Connections[Connection]" in the connection manager collection, Connections, of "PQS_SUPERBOWL_TEAMS" does not have a value for the ID property. Verify that the ConnectionManagerID property of the runtime connection object has been set for the component.

Error at DF_GRAB_SUPERBOWL_TEAMS [SSIS.Pipeline]: PQS_SUPERBOWL_TEAMS failed validation and returned error code 0xC004801C.

Error at DF_GRAB_SUPERBOWL_TEAMS [SSIS.Pipeline]: One or more component failed validation.

Error at DF_GRAB_SUPERBOWL_TEAMS: There were errors during task validation.

 (Microsoft.DataTransformationServices.VsIntegration)

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

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

'gacutil' is not recognized as an internal or external command

The Script Task uses version 15.0 script that is not supported in this release of Integration Services

$
0
0

Hi All,

We are migrating an SSIS project from SQL 2012 to SQL 2016. The project upgraded successfully without any issues and able to run few packages without any errors. But there are few packages which has got the script task and they are failing. The error message is as below: -

Error: There was an exception while loading Script Task from XML: System.Exception: The Script Task "ST_bb19096e98ab45d2a2d6132b995cd509" uses version 15.0 script that is not supported in this release
of Integration Services. To run the package, use the Script Task to create a new VSTA script. In most cases, scripts
are converted automatically to use a supported version, when you open a SQL Server Integration Services package
in %SQL_PRODUCT_SHORT_NAME% Integration Services. at
Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask.Load
FromXML(XmlElement elemProj, IDTSInfoEvents events)

This runs fine when run from BIDS (VS2015). It also runs fine if the project is deployed from BIDS and run through agent job. But when the deployment happens through .ispac (deployment) file, this error occurs. Can somebody suggest how to get past this error?

Is it any known issues with migration or with SSIS 2016?

Thanks.


صيانه ال جي 01225025360 | اعطال ال جي 01127571696

How do you deploy a Visual Basic program with a database

$
0
0

I am at a point in the project where I want to publish the project together with the database.

I want to supply it to the user on a CD with the database, but I don't know how to add the database files to the database.

Using publish I get it to install SQL Server locally, but then I'm stuck, as I don't how to transfer all of the tables to the database without user intervention.

I have been using a tutorial on SSIS but I am not sure of the steps I need to take to tranfer the data.

Has anyone any examples and a list of steps I need to do to acheive this?

I would be gratefull for any help!


TEH

SSIS job fails when scheduling it in SQL agent

$
0
0

Hello,

 I have a SSIS package that is basically running a SQl script (OLE DB source) and putting the output to a csv file (flat file destination). When i execute the package from within Visual studio, the job works as expected with the required result. I wish to now schedule the job so i am using SQL server agent via SSMS, i keep getting this error. 

The SQL Server instance specified in SSIS service configuration is not present or is not available. This might occur when there is no default instance of SQL Server on the computer. For more information, see the topic "Configuring the Integration Services Service" in SQL Server 2008 R2 Books Online

I have used my windows credentials (which needs to be reset every 60 days) to create the package and the OLE db has a different username and password to run the query against the DB. i have set the protection level and followed the steps exactly as del campo has suggested. The db user is a sysadmin and the password for it never changes. 

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/7dffb586-2e9f-4901-ac29-dcc37e9070ff/sql-server-agent-job-will-not-retain-package-password-encrypt-sensitive-with-password?forum=sqlintegrationservices


Please advise on how to resolve this. 

conversion failed when converting the varchar value 'id :' to data type int.'

$
0
0
 private void buytichet_Click_1(object sender, EventArgs e)
        {

             SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;Initial Catalog=event_manegment;Integrated Security=True");
             con.Open();
             string query = "insert into event_user(Event_id) values('" + UserNameup.Text + "')";
             SqlDataAdapter sda = new SqlDataAdapter(query, con);
             sda.SelectCommand.ExecuteNonQuery();

             cmd.Parameters.Add("@Event_id", textBox1.Text);

             MessageBox.Show("db entered");


             //cmd.Parameters.Add("@User_id", textBox2.Text);
             con.Close();
        }

Schedule SP in SQL Agent

$
0
0

I have an stored procedure which run an ssis package.

Below is the script

CREATE PROCEDURE MRA
AS
Declare @execution_id bigint
EXEC [SSISDB].[catalog].[create_execution] @package_name=N'CNP_FORMAT.dtsx',
@execution_id= @execution_id OUTPUT,
@folder_name=N'MRA',
  @project_name=N'CNP_FORMAT',
@use32bitruntime=False,
  @reference_id=Null
EXEC [SSISDB].[catalog].[start_execution] @execution_id

When script is run manually in SQL server, targeted table are uploaded correctly.

I have schedule above stored procedure in SQL Agent.

Schedule Job runs without errors but targeted table NOT uploaded!!!

Means the schedule job in SQL Agent did not run the ssis package!

I'm currently stuck with this issue and don't know how to proceed.


GETDATE () - 1 on SSIS

$
0
0

Hi,

I created a variable in SSIS, but it doesn't accept GETDATE () -1

REPLACE( @[User::FilePath] , ".xls","" )+"_" +  (DT_WSTR,4)DATEPART("yyyy",GetDate()) + RIGHT("0" + (DT_WSTR,2)DATEPART("mm",GetDate()) ,2) + RIGHT("0" + (DT_WSTR,2)DATEPART("dd",GetDate()),2) +".xls"


How can I solve this problem?

Thank you.


Execute DTSx in visual studio 2019

$
0
0

Hi 

I new in SSIS .

I have a problem with execute a package (DTSx) in Visual Studio C# 2019

I follwed the instructions in the microsoft help page but  I didn't succeed.

I have questions about parameters.

folderName

projectName

And how to use  

 Catalog catalog = integrationServices.Catalogs["SSISDB"];

Can somebody help me, please?

 string targetServerName = "localhost";
            string folderName = "Project1Folder";
            string projectName = "Integration Services Project1";
            string packageName = "Package.dtsx";

            // Create a connection to the server
            string sqlConnectionString = "Data Source=" + targetServerName +";Initial Catalog=master;Integrated Security=SSPI;";
            SqlConnection sqlConnection = new SqlConnection(sqlConnectionString);

            // Create the Integration Services object
            IntegrationServices integrationServices = new IntegrationServices(sqlConnection);

            // Get the Integration Services catalog
            Catalog catalog = integrationServices.Catalogs["SSISDB"];

            // Get the folder
            CatalogFolder folder = catalog.Folders[folderName];

            // Get the project
            ProjectInfo project = folder.Projects[projectName];

            // Get the package
            PackageInfo package = project.Packages[packageName];

            // Run the package
            package.Execute(false, null);

        }
    }


Cleansing of Mainframe data - Decimal Formatting

$
0
0

Hi, I am new to SSIS and I have this requirement of importing Mainframe Data from text files(without delimiters). I figured out that Ragged Right should go well, but I have problems with certain fields. For example, there are columns with data like +01000000,+0145000.... and so on in every file. Here in the case of +01000000, I have to do the cleansing and load it into SQL server so that the data looks like +0100.0000. (this is just an example and there are many fields like this). Any lead on how to go about this?

Thank you !

How to create ssis doing import data from excel to database sql server 2012 ?

$
0
0

problem

How to create ssis doing import data from excel to database sql server 2012 then show result status on excel ?

i work on sql server 2012 i create stored procedure import data from excel to database 

steps for work 

1- i create excel 2010 have textcolumns companyName,textcode,MetaData

2-store data on temptable and validate it if any thing form entry data not have id on my database or empty then status will not valid 

3-insert data if status =null that meaning no error 

4-status will be insert to record inserted

5-record have wrong or status not =null meaning have wrong data

6- i collect both inserted and not inserted as output excel sheet to kno reasons of record 

not inserted 

and records not inserted and show reasons on status field on excel output

i here using openrowset i need to make it using ssis package 

How to make steps above using ssis package 

Exec [PCN].[sp_MasterDataInsert]'\\192.168.3.108\Import\CompanyNewsInputTemplate.xlsx','\\192.168.3.108\export\CompanyNewsOutputTemplate.xlsx'

create proc  [PCN].[sp_MasterDataInsert]
  


@ImportFilePath varchar(500) , 

@ExportFilePath varchar(500)

as 

begin 
create table #TempMaster(
Id int identity,
CompanyId  nvarchar(200),
CompanyName  nvarchar(50),
DocumentRevision_ID  INT,
DoconlineUrl   nvarchar(300),
DocofflineUrl  nvarchar(300),
AttachementRevision_ID  INT,
TextCode   NVARCHAR(500),
MetaData   NVARCHAR(500),
AttachonlineUrl   nvarchar(300),
AttachofflineUrl  nvarchar(300),
SourceGeneralTypeID int,
SourceGeneralType  nvarchar(50),
ImageGeneralTypeID  int,
ImageGeneralType nvarchar(300),
InitialPriGeneralTypeID  int,
InitialPriGeneralType nvarchar(300),
DailyBacklogGeneralTypeID int,
DailyBacklogGeneralType nvarchar(300),
[Status]  VARCHAR(50)
)

Declare @sql nvarchar(max)

Set @sql= 'insert into #TempMaster
(
        
		CompanyName ,
		DoconlineUrl,
        DocofflineUrl,
		AttachonlineUrl,
		AttachofflineUrl,
		SourceGeneralType,
		ImageGeneralType,
		InitialPriGeneralType,
		DailyBacklogGeneralType,
		TextCode,
		MetaData

		
)
Select 
		CompanyName ,
		DoconlineUrl,
        DocofflineUrl,
		AttachonlineUrl,
		AttachofflineUrl,
		SourceGeneralType,
		ImageGeneralType,
		InitialPriGeneralType,
		DailyBacklogGeneralType,
		TextCode,
		MetaData

        FROM OPENROWSET( ''Microsoft.ACE.OLEDB.12.0'', ''Excel 12.0 Xml;HDR=YES;Database=' + @ImportFilePath + ''','' SELECT  * FROM [Sheet1$]'')'

Exec(@sql)






update tmp
set tmp.CompanyId=c.CompanyID
from #TempMaster tmp 
INNER join  Z2DataCompanyManagement.[CompanyManagers].[Company] c on 
					 c.CompanyName =tmp.CompanyName
where tmp.[Status] is null

update tmp
set tmp.[Status]='Company Not Found'
from #TempMaster tmp 

where tmp.[Status] is null
and tmp.CompanyId is null
--====================================

update tmp
set tmp.SourceGeneralTypeID=c.GeneralTypeID
from #TempMaster tmp 
INNER join  [PCN].[GeneralTypes] c on  c.GeneralTypeName =tmp.SourceGeneralType and c.TypeID=1				 
where tmp.[Status] is null and c.GeneralTypeID is not null

update tmp
set tmp.[Status]='Source Type Not Found'
from #TempMaster tmp 
where tmp.[Status] is null
and SourceGeneralTypeID is null


update tmp
set tmp.DailyBacklogGeneralTypeID=c.GeneralTypeID
from #TempMaster tmp 
INNER join  [PCN].[GeneralTypes] c on 
					 c.GeneralTypeName =tmp.DailyBacklogGeneralType and c.TypeID=2
where tmp.[Status] is null and c.GeneralTypeID is not null

update tmp
set tmp.[Status]='DailyBacklogGeneralTypeID Type Not Found'
from #TempMaster tmp 
where tmp.[Status] is null
and DailyBacklogGeneralTypeID is null






update tmp
set tmp.[Status]='MetaData Not Found'
from #TempMaster tmp 
where tmp.[Status] is null
and MetaData is null

update tmp
set tmp.[Status]='TextCode Not Found'
from #TempMaster tmp 
where tmp.[Status] is null
and TextCode is null









insert into 
[PCN].[MasterData]
( 
		CompanyID ,
		DocumentRevision_ID,
        AttachementRevision_ID,
		SourceGeneralTypeID,
		ImageGeneralTypeID,
		InitialPriGeneralTypeID,
		DailyBacklogGeneralTypeID,
		TextCode,
		MetaData,
		 CreatedBy ,
         CreatedDate ,
         ModifiedDate
		
)
select	
		CompanyID ,
		DocumentRevision_ID,
        AttachementRevision_ID,
		SourceGeneralTypeID,
		ImageGeneralTypeID,
		InitialPriGeneralTypeID,
		DailyBacklogGeneralTypeID,
		TextCode,
		MetaData,
		@CreatedBy ,
        GETDATE() ,
        GETDATE()
		
from #TempMaster tmp
where tmp.[Status] is null

update tmp

set tmp.[Status]='Inserted'

from #TempMaster tmp 

where tmp.[Status] is null





DECLARE @Export varchar(max) 
SET @Export = 
'INSERT INTO OPENROWSET(''Microsoft.ACE.OLEDB.12.0'',''Excel 12.0 Xml;HDR=YES;Database='+ @ExportFilePath +''',''SELECT * FROM [Sheet1$]'') 
select
 CompanyName ,
		DoconlineUrl,
        DocofflineUrl,
		AttachonlineUrl,
		AttachofflineUrl,
		SourceGeneralType,
		ImageGeneralType,
		InitialPriGeneralType,
		DailyBacklogGeneralType,
		TextCode,
		MetaData,                
		[Status] 
	from #TempMaster' ;
 execute (@Export);


drop table #TempMaster

End






Viewing all 24688 articles
Browse latest View live