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

Copy Database - name changing prevents successful copy

$
0
0

I have a strange problem while copying a database on SQL Server 2012.

What I want to achieve is to copy a local database. The destination is on the same server.

If I keep the suggested destination database name it works as expected but if I change it, it gives me the following error:

Event Name: OnError
 Message: An item with the same key has already been added.
StackTrace:    at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Microsoft.SqlServer.Management.Smo.DataTransferBase.SetupDatabaseForDestinationScripting(Nullable`1 modelSize, Dictionary`2& strAryOldDbFileNames, Dictionary`2& strAryOldLogFileNames, Dictionary`2& oldFileSizes)
   at Microsoft.SqlServer.Management.Smo.DataTransferBase.GetScriptLoadedTransferWriter()
   at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()
   at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferDatabasesUsingSMOTransfer()

It looks like SQL Server remembers my previous copy although I deleted the database in Management Studio and even removed the files in SQL Server's "DATA" directory.

Is there any catalogue I have to clean up or did I forget something?

Thanks Daniel


SSIS Project Parameters in SQL Server

$
0
0

I wonder how i can esure that a package uses project parameters when installed in SQL Server SSISDB.

I have a SSIS project where i have delcared som project.parameters for userid and password and URL to a webservice.

Then from a script component i read these parameters.

oHIT = New FLISHITWS.FlisHitDataService         
oHIT.Timeout = Variables.Timeout
oHIT.Url = Variables.WebServiceUrl
oHIT.Credentials = New NetworkCredential(Variables.UserId, Variables.Password, Variables.Domain)

oDs = oHIT.gettableboktyp("jbo")

For Each oRow In oDs.Tables(0).Rows

 twboktypoutputBuffer.AddRow()
 twboktypoutputBuffer.boktyp = Convert.ToInt32(oRow("boktyp").ToString())
 twboktypoutputBuffer.boktypkort = oRow("boktypkort").ToString()
 twboktypoutputBuffer.beskr = oRow("beskr").ToString()
 twboktypoutputBuffer.sparrad = Convert.ToBoolean(oRow("sparrad").ToString())
 twboktypoutputBuffer.EndOfRowset()
Next

But when i have installed it by deploy to an Integration services catalog (SSISDB) the parameters seem to be lost. I can create an environment in SQL server and manually set the parameters for each package and get it to function.

But this is rather cumbersome and when i have to redeploy the project i have to do it all again. I think i am missing something here. Any ideas?

Best regards

John



Checking for Null Values in SSIS Derived Column

$
0
0

Hello!

While loading a table I got an error ; "Invalid character value for cast specification", and "Conversion failed because the data value overflowed the specified type." I understand that this could be as a result of null or blank in the table. and therefore decided to transform it with a Derived Column transform. But my expression on Date data type (Datetime) types are giving issues. I am loading into another table columns with Datetime into and another column with Smalldatetime and a Float column into another Float column

Below is my expression in my Derived Column:

AppointmentTime  Replace 'AppointmentTime'  (ISNULL( [AppointmentTime]  )? "0.00" : AppointmentTime  double-precision float [DT_R8]        

AppointmentDate  Replace 'AppointmentDate'  ISNULL( [AppointmentDate]  )? " " : AppointmentDate  database timestamp [DT_DBTIMESTAMP]        

Now the issue is the expression is throwing error from both the Float and the Datetime columns.

How do I write the expression better. I am pretty sure I can load a Datetime column into a Smalldatetime    

Your help is much appreciated.

Thank you!


Zionlite


Run stored procedure that use catalog procedures of SSIS with windows user with minimum rigths

$
0
0
Hello everybody:


I need run dtsx packages mounted in SSIS catalog with parameters, throught an stored procedure, because one aplication fired dtsx  using stored procedure with parameter values


I have created the stored procedure using SSISDB.Catalog.Create_Execution, Set_Execution_Parameter_Value, and Start_Execution. This works, but for run the user need have  db_owner privilegies on principal_db and ssis_admin on SSISD this will only run if the executing user is a windows account, no problem with this but I need the windows account have minimal rigths on principal_db, I know I can't do it using Sql user because is necesary an windows account but when I create my procedure give execution permition for execute stored proc to an win user in the principal database, create the win user on SSISDB and give permision on catalog procedures  SSISDB.Catalog.Create_Execution, Set_Execution_Parameter_Value, and Start_Execution and add to my stored procedure the clause "execute as owner",show me next error:

I tried using Execute As and specifying a windows account but I get the error "The current security context cannot be reverted. Please switch to the original database where 'Execute As' was called and try it again."

I tried using "execute as self" and when I try run the procedure with another win user (that give permision) show me is necesary windows account.

My user have permision on db_owner, sysadmin,and ssis_admin, I think i need come into my permisions to an user for execute this, considering that my procedure working with 2 databases principal_db (where record my procedure) and SSISDB (where live the catalog procedures for create execution and put parameters)
.

Somebody can help me?


check if object isnull or not

$
0
0

hi all please see attached image.  I'm trying to add a precedence constraint to check to see if any emails are found or not.  If emails are found, carry on, if not check sftp file location (we can receive files by both email and sftp).  ISNULL does not work with object data type so how do i get around this??? Thanks!

I'm using cozyroc receive email task which outputs a result variable as object

ISNULL( @[User::MailList]  ) if true check folder location if false carry on with exchange tasks...

hmm... image upload isn't working...

How may I approach this ETL logic?

$
0
0

I have three pkgs.

Organization (runs first)

Department (runs second)

Employee(runs third)

Source file for Organization will have OrganizationID + DepartmentID + EmployeeID + ErrorFlag

i.e. 1 1 1

now, DepartmentID and EmployeeID cannot repeat for another OrganizationID

i.e. 1st record = 1 1 1 and 5th record = 4 1 1 (this cannot happen).

If that happens, I want to mark that 4 1 1 record as True for ErrorFlag column.

I want to then apply same logic for Department where 1 emp cannot be in multiple dept.

Can I get some ideas on how to approach that in ETL? I want to mark the 2nd+ instance of duplicate foreign values to True.

Thank you

SSIS- Dynamic table, CSV FIle

$
0
0

Hello,

Can somebody please refer me to a few articles, below is my problem statement.

-> Import file format CSV.

-> Based on the number of columns in CSV, create a table dynamically with the columns.

I'm Using SQL Server 2008 R2

I'm not allowed to use dynamic queries :(

Please advice.

Thanks

Swat

SSIS OnPostExecute Event handler firing before OnError event handler

$
0
0

Hi,

I have an SSIS package with OnPostExecute  and OnError event handler. For some reasons OnPostExecute  is firing before OnError. (The progress window confirms that and I also tested with a messagebox)
Is it suppose to work like that?
I am new to ssis and so I might be doing something wrong. please help

Thanks

Swamy


Set MaximumErrorCount does not work!

$
0
0

Hi,

 

I'm new in SSIS and I'm trying to copy data (1 table) from server1 to server2; I've set the MaximumErrorCount to 10 at control flow level, the transfer fails with this message :

 

Warning: The Execution method succeeded, but the number of errors raised (3) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

 

1. I'm wondering why SSIS tells me the maximum allowed (1) even if MaximumErrorCount = 10 ? do I miss something in settings ?

 

2. How to tell SSIS to transfer fails row to flat file and continue to processes next rows.

 

Thank you very match for your help

 

MS server connect to MySQL (ODBC)

$
0
0

I just installed SQL Server 2008 R2.  I added mysql-connector-odbc-5.1.6-win32.msi to connect to MySQLl database. It is not working properly . Please help – what driver can be used?

- (VStudio 2008) when  try to add/remove tables for DATA Source Views , I am getting an error

ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.1.32-community-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[ fchclient]' at line 2 (myodbc5.dll)


 -  (VStudio 2008) when try to add ADO.NET with data access mode: table or view, I  am getting an error :

TITLE: Microsoft Visual Studio
------------------------------

Error at Data Flow Task [ADO NET Source [1]]: The component "ADO NET Source" (1) was unable to retrieve column information for the SQL command. The following error occurred: ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.1.32-community-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"art"' at line 1

 

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

Pipeline component has returned HRESULT error code 0xC02020FF from a method call. (Microsoft.SqlServer.DTSPipelineWrap)

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

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

 -  (VStudio 2008) when try to add ADO.NET with data access mode: SQL command - is working.

 

How to add an dll to GAC and reference the dll in SSIS Script task?

$
0
0

Hi ,

I am working on a package which needs an external dll.I got the dll file but i don't know how to add an dll to Gac.

I tried gacutil.exe to add an dll but it throws me an gacutil is not recognized as an external or internal command.When i researched on the issue i need to do it from visual studio command prompt tools.But i didn't find the the prompt in tools for visual studio 2008 tools.But i found the gacutil.exe file in C:\Program files(X86)\Microsoft SDKs\Windows\v7.0A\Bin folder.

My question is how can i add the Dll to GAC and reference the Dll in SSIS.

Any help is appreciated.

Calling package from C# fails with bad OleDbConnection

$
0
0

I have a VS2012 solution with a number of projects, one of which is based on SSIS.

The package reads in a CSV flat file, filters it, clears a SQL Server 2008 table and then loads the CSV file into that table. The environment is Windows 7 x64. The SQL Server instance is not on the local machine.

When I execute the package directly in Visual Studio, it completes successfully. However, when I call it programmatically, it fails. I do not know what to try next. My hunch is that there's something weird with the password. 

I would appreciate any suggestions - Thanks

Code calling package:      

      private static void importToDatabase(string fullPath)
      {
         MyEventListener listener = new MyEventListener();
         Application app = new Application();
         Package package = app.LoadPackage("package.dtsx", listener);
         DTSExecResult pkgResults = package.Execute(null, null, listener, null, null);
         Console.WriteLine("Package results: {0}", pkgResults);
      }
   }

   class MyEventListener : DefaultEvents
   {
      public override bool OnError(DtsObject source, int errorCode, string subComponent,
        string description, string helpFile, int helpContext, string idofInterfaceWithError)
      {
         Console.WriteLine("Error in {0}/{1} : {2}", source, subComponent, description);
         return false;
      }
   } 


Error message from MyEventListener:
Error in Microsoft.SqlServer.Dts.Runtime.TaskHost/SSIS.Pipeline : Cannot find the connection manager with ID "{C25724AB-D25F-48EB-B821-0D24E2E9FB98}" in the connection manager collection due to error code 0xC0010009. That connection manager is needed by "OLE DB Destination.Connections[OleDbConnection]" in the connection manager collection of "OLE DB Destination". Verify that a connection manager in the connection manager collection, Connections, has been created with that ID.


From package.dtsx:
              <connections>
                <connection
                  refId="Package\Import Data\OLE DB Destination.Connections[OleDbConnection]"
                  connectionManagerID="{C25724AB-D25F-48EB-B821-0D24E2E9FB98}:external"
                  connectionManagerRefId="Project.ConnectionManagers[ZEBAY.Mail.pow]"
                  description="The OLE DB runtime connection used to access the database."
                  name="OleDbConnection" />
              </connections>

From ZEBAY.Mail.pow.conmgr:    
<?xml version="1.0"?>
<DTS:ConnectionManager xmlns:DTS="www.microsoft.com/SqlServer/Dts"
  DTS:ObjectName="ZEBAY.Mail.pow"
  DTS:DTSID="{C25724AB-D25F-48EB-B821-0D24E2E9FB98}"
  DTS:CreationName="OLEDB">
  <DTS:ObjectData>
    <DTS:ConnectionManager
      DTS:ConnectionString="Data Source=ZEBAY;User ID=pow;Initial Catalog=Mail;Provider=SQLNCLI11.1;Persist Security Info=True;Auto Translate=False;">
      <DTS:Password
        DTS:Name="Password"
        Sensitive="1">AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAhI0KfBwx2EK6eU0KGMzzJwAAAAACAAAAAAAQZgAAAAEAACAAAABmoDqlG38/fl0EmUKR4SibW+9bIlEG4ZkrpIUBJG8yNgAAAAAOgAAAAAIAACAAAABGugaTuSIDMg2k4l4v8bu6OnhCjvsiVf+BJp80OvHN5IAAAADzq/Ht1y50sNtTeqYG/sj3YHGR+0q5Q/bTusEE5yzGjurzBNFuE230QspL+8hXlrqc+9+Wcqp1x/PFeMuinT5YjCD15iOw62gF2/xh8FKwK5v1IU09jNpvVjzphE6gxlze+pxkLf0n9xZHda7rjee5gcrnaEpEX1Za7WzyaNrfXEAAAAAXtvrXxoXugYmFEqRrDe1VCpsxyUT5vwBCHXp9oGUIyhn9amfyhdoJ6NG4ZjUsbp88/+qRTFNii2WmiyO2/MXC</DTS:Password>
    </DTS:ConnectionManager>
  </DTS:ObjectData>
</DTS:ConnectionManager>

              

Write to Log from Script task with in a OnPostExecute Event Handler

$
0
0

Hi 

I have a script task on OnPostExecute Event handler and trying to write a log from this script task.

There is no log written from the event handler and this script task is not even listed in the logging containers list.

Is it possible to write to log from event handlers / script task with in a event handler

Thanks,

Swamy

SSIS extracting from Oracle and generating .csv file

$
0
0

Hi,

I have a simple requirement, I will try to explain the below, I would like to know how can I achieve this using SSIS.

1. I have a table in SQL Server which contains only one column 'LastUpdated' this is of type DateTime. Please note that this table will always contain one row.

2. In my SSIS Package, I would want to extract the value of LastUpdated

3. Next, I need to connect to Oracle database and extract values from a table with filter condition of > LastUpdated from SQL Server table.

4. Export the data to .CSV file

My Solution:

I have an Execute SQL Task on my Control Flow and from there, I am able to execute SQL query and extract the value in a variable named @LastUpdDt

I want to pass @LastUpdDt to Oracle query using ADO.Net source by specifying SQLCommand. Is this the correct approach, if not, can you please suggest me what should I be using. My query should be: Select * from OracleTable where objDate > @LastUpdDt

Once I get the result set, I need to export the data to .CSV file.

Thanks for looking into this post.

Cheers!!!

validating sequence container freeze

$
0
0
I am attempting to open up my ssis integration project but when I try to open up packages it says @ the bottom "Validating Sequence Container" and it just stays there.  I cannot click on anything and nothing is responsive.  Does anyone know why this is happening?

SSIS Package using VisualFoxPro Driver on 64bit 2008 R2 not working consistently

$
0
0

I have this package - it simple moves data out a Visual FoxPro Table and unpivots it into a SQLServer 2008 table. It works beautifully in BIDS. It's basically a Script Task with code to run through the table.

Normally it would have two R/W parameters (one of which is m_filename) - but I have also put some default values in it when I constructed the package - so hopefully it runs on its own. It doesn't have connection manager elements - as they have been hardcoded.

Dim outputConnAsNew OleDbConnection("Provider=SQLNCLI10;Data Source=localhost;Initial Catalog=Reporting;User ID=xxxxxx;Password=xxxxxx")

       

Dim inputConnAsNew OleDbConnection("Provider=VFPOLEDB.1;Data source="& Dts.Variables("m_filename").Value &";Extended Properties=dBase III;")

I want to call it from a .NET web application through a Stored Procedure.

1. Loaded as Agent Job (looks like the right syntax…

 

When I start the job then the message comes up that it cannot set the m_filename – how can I resolve this?

When this package runs it actually works as 32-bit (in title!) So we simply need to get the variables set!

Decided to remove the need to load the m_filename etc. so no parameters were loaded and the package validation returned DTSER_SUCCESS (0). (So it would use the default values). But no records loaded!

  2. Direct in a Stored Procedure

In a stored procedure we use the following command which I simple run and what is generated is the result set with errors below.

DECLARE @result varchar(500)

EXEC @result = master..xp_cmdshell 'dtexec /x86 /f "c:\cube\VFPImport.dtsx" /SET \package.Variables[User::m_filename].Value;"C:\DBFDATA\TEST_REPORT.DBF" /SET \package.Variables[User::m_version].Value;"VT7777"'

When I run this I get the error which suggests that VFPOLEDB.1 is not registered – and yet it was registered to run when in BIDS on the same machine. How do I force the registration in SQLServer - that can work?

However note that even though I used the /X86 switch to make it 32 bit mode – the utility seems to be the 64bit utility in the debug title! So the switch doesn’t work! They say that there is a different DTEXEC: one for 32 bit and one for 64bit. I think this is the reason that the process if failing to find the VFPOLEDB.1. If it found it – we still have to get over the fact that we cannot set the parameter values.

When I took the parameters out and just run the package with defaults it still came out with the same problem

3. Loading into SQLServerIntegration Services section of SQLServer (not SQLAgent)

By starting up Integration Services – I was also able to load the package – but again the same no reading m_filename  error. Could this be a privilege thing do you think?

This time I ran it without the parameters so using default.

It worked perfectly.

Then I checked and the records were in place! So leaving 8702 records for 110 records in the system. But clearly I am going to have problems running this unless I can do it properly through a SP? What seems to be wrong?

The code works in BID really well - which is wonderful - as I hear so much about problems working with VFPOLEDB.1

Steve

Insert field names in o/p flatfile

$
0
0

Hi Gurus, 

I was wondering if it is possible to insert field names before creating a flat file. I am using 2 excel files as different sources with no field names in it. And I have to modify the file to have different widths between the columns and  have to produce one text file merging two excel files data. Everything seem to work fine until customer asked to insert field names which i know.  But the I am not sure how to insert field names before producing the text file. Is there a way using SSIS without .net or C# code?

Please help me with this. 

SSIS - how to debug into a child package (stored in MSDB) using execute package task from BIDS

$
0
0

Hi there

Just wondering if i'm missing a BIDS setting regarding this. I want to debug into a child package (stored in SQL Server MSDB) through BIDS which is called from an Execute Package Task. When i run it, it doesn't go into that package so i can't debug it. Its hard running it standalone as there's a million variables set from the parent.

Anyway, i know there's ways round it via dynamic scripts, configs etc to set the required connection manager but isn't there simply a setting which allows you to debug into non file based child packages from a parent? Seems odd that you would either have to faff with setting the things dynamically or maintaining a separate debug project using packages stored in the file system.

Thanks in advance. Jon

"Based on the system configuration, the maximum concurrent executables are set to 4". Need help with this

$
0
0

Hello!

I have an SSIS Package with runs great when I am in debugging mode with BIDS, however, as soon as I run it without debugging (cntl- F5) it give me "Based on the system configuration, the maximum concurrent executables are set to 4".

Can anyone help me with running a package in non debug mode? I also have another SSIS Package on the same machine which when running in non debug, gives the same message.

Thanks!
MIke


Mike Kiser

Error Controls

$
0
0

Hi!

I have a package that contains six Lookup Transform. The package runs fine but I had to configure error at every single Lookup by sending the error output to a different transform. And that means adding more transforms to the package. Is there a way I can bring every error from each Lookup transform to a single transform that will then capture the errors?

Thank you!


Zionlite



Viewing all 24688 articles
Browse latest View live


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