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

more than one code page specified error

$
0
0

I got error as following when getting data from a .txt file to a sql table using OLE DB connection.  The following error seems to be telling me the same thing, or may not !  When I set the oledb destination property AlwaysUseDefaultcodePage to TRUE, error 10 (see below) went away.  but not Error 5.   Can you help?  I have also set the the OLE DB destination property to have the code page at 65001.  It didn't help.

 

 

Error    5    Validation error. Data Flow Task OLE DB Destination [333]: The column "Business Unit" cannot be processed because more than one code page (65001 and 1252) are specified for it.      LoadStaging.dtsx    0    0   

 

Error    10    Validation error. Data Flow Task: Data Flow Task: The column "Business Unit" cannot be processed because more than one code page (65001 and 1252) are specified for it.      LoadStaging.dtsx    0    0   


BR Ann L.

File watcher task help

$
0
0
I am using this file watcher task:

http://www.sqlis.com/sqlis/post/File-Watcher-Task.aspx

When my user places a file in a directory it fires off and sends the file via FTP.

Works fine, but my question/problem is I need for my package/job to run 24 hours a day. How do I schedule this as job? Do I schedule the job to run every minute? Then if I do that it sends an error (because there is no file there)

Do I just turn off the error notification? Or is there a better way I'm not thinking of?

qeqw

Reg. Excel Creation using Interop dll

$
0
0

I have a SSIS package, containing a SSIS Script Task to Create Excel using Microsoft Excel Interop DLL.  It works fine when executed manually in a particular server.  I have automated the same with Windows Services, which calls the SSIS package, but then Excel is not getting created.
I use the same service account ID for Manual / Service call Login, that has Admin access to the particular server, yet it is not able to Create the excel .

OS :- Window 2008 R2 Server
Excel :- Excel 2010 64 Bit
SQL Server 2008 R2 64 Bit

How to check for only specific number of defined columns

$
0
0

Hi,

I have a situation where i need to check for a specific number of columns coming in

for example i have .csv file where there are 10 columns delimited by ,

if i get more than 10 columns i need to redirect to another table

if i get less than 10 columns i need to redirect to another table

please help me

thanks,

Cannot read variable value from another connection type

$
0
0

Hi,

In my ssis package control flow, in connection1 got the recordset and stored in object variable. Executing foreach loop container by using this object variable. Inside the Foreach loop container two SQL task , one is in connection1  and another one is connection2. The connection1  sql task is running. but in connection2 sql task is not running. Its giving error like" Error: Cannot assign a default value to a local variable. " "Must declare the variable value."

I want to update both server tables inside the loop. If i use another connection manager is throwing error.

Whats the mistake am i doing?

or i cant use like this?

Thank you guys

Script task - Assign List to an Object Variable

$
0
0

Hi all,

Wonder if anyone can help.

I am trying to load an Object Variable with the results of an array.

But when I show the object variable via a message box I get this:

System.String[]

In the code I display a message box with a random array element to verify the data looks okay.

Any idea ?

Here is my code

        private void GetSecuritiesData()
        {
            int StartOfData = AllLines.IndexOf("START-OF-DATA") + 1;
            int EndOfData = AllLines.IndexOf("END-OF-DATA") - 1;

            for (int i = StartOfData; i <= EndOfData; i++)
            {
                SecuritiesData.Add(AllLines[i].ToString());
            }
            MessageBox.Show(SecuritiesData[10]);
            string[] s = SecuritiesData.ToArray();
            Dts.Variables["OutFileSecData"].Value = s;
            MessageBox.Show(Dts.Variables["OutFileSecData"].Value.ToString());
        }

convert yymmdd to ccyymmdd using ssis

$
0
0

Hi All,

My source  date is in yymmdd format.I need it in ccyymmdd format using ssis derived column

Please send me the expression ASAP.

Thanks

RH


sql

How to generate T-SQL commands, store them, then later step through and execute?

$
0
0

Hello,

Question: In SSIS 2008, how is it possible to store a recordset of T-SQL commands and then execute them later in the package?

Background: I'm using a Transfer Database Task to copy a database from Server A to Server B, but I had to manually correct the newly-created orphan users and re-add the intended users and add them back to their respective roles on Server B.  With the goal of adding these two steps to the package so it's done as part of the Job, I created a query (#1) that generates a "If-user-exists-then-drop-user" T-SQL command for each user and another query (#2) that generates a "If-user-does-not-exist-then-create-user" T-SQL command in one column and "EXEC sp_addrolemember" T-SQL commands in another column for each user.  So my order of operations should be: 1) execute script #2 and store the results, 2) run the database transfer task, 3) execute script #1 and store the results, 4) execute the stored results of script #1, 5) execute column 1 of the stored results of script #2, 6) execute column 2 of the stored results of script #2.

(I recognize that, for simplicity, I could break out script #2 into two scripts that return one column each and then split step 6 into steps 6 and 7.)

Thanks for your help!
-Eric


Excel : Sheet locked by the Windows

$
0
0

Hello Everyone

I am trying to access a excel sheet from the SSIS script task. I have written following code

  Public Sub Main()
        Dim appexcel As Object
        Dim newbook As Object
        Dim Sheet As Object
        Dim Connection As String = Dts.variables("User::V_FilePath").value 
        MsgBox(Connection)
        appexcel = CreateObject("Excel.Application")
        newbook = appexcel.Workbooks.Open(Connection)
        Sheet = newbook.worksheets("Error")
        Sheet.UnProtect(Password:="ALF")
        newbook.Save()
        newbook.Close(False)
        appExcel.quit()
        Dts.TaskResult = ScriptResults.Success
    End Sub

I am trying to lock the cells in one of the sheet in the workbook. It's working fine to lock the cells. But, the problem is after the running the script it locks the file and after that I am not able to open it in edit mode. I only want to lock the cells. Is there anybody who can help in code and to unlock the file.?

Question on Retain null values from source as null values in data flow

$
0
0

We are writing a SSIS package to export a table to flat file and  following is the table structure:

Create table dd(dd int not null, dd1 nvarchar(100) not null, dd2 nvarchar(100) not null, dd3 int)

Column dd1 and dd2 can have value as ‘ ‘ or ‘  ‘ to avoid not null issue since space is not null for SQL Server so source data is fine and column dd3 can be null.

Now during import if we use option “Retain null values from source as null values in data flow” to false then dd1 and dd2 are imported fine but dd3 got value 0 (default for int)

And we if set the option to true then SSIS import consider ‘ ‘ as null and dd2/dd3 column fails for not null constraint.

Is there any option to specify this setting at column level or what is the best way to solve this issue without using derived table?

Execute Process task: Unexpected exit code

$
0
0
In Executing "E:\EmailDelivery.exe" "EP12A 4" at "", The process exit code was "-532459699" while the expected was "0". 

The VSTA designer failed to load: "System.Runtime.InteropServices.COMException (0x80004005):..."

$
0
0

[I'm reposting here as requested in the SQL Server Setup & Upgrade forum.]

I've just reinstalled the OS and apps on my PC.  When I open a script task and click "edit script..." I get this message:

------------------------------
Cannot show Visual Studio 2008 Tools for Applications editor.
------------------------------
ADDITIONAL INFORMATION:

The VSTA designer failed to load:  "System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at VSTADTEProvider.Interop.VSTADTEProviderClass.GetDTE(String bstrHostID, UInt32 dwTimeout)
   at Microsoft.SqlServer.VSTAHosting.VSTAScriptingEngine.EnsureDTEObject()" (Microsoft.SqlServer.VSTAScriptingLib)
------------------------------

When I run

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE>vsta.exe /hostid SSIS_ScriptTask
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE>vsta.exe /hostid SSIS_ScriptComponent

VSTA fails to start up and I get:

---------------------------
Microsoft Visual Studio Tools for Applications 2.0
---------------------------
Registration information for this application needs to be updated. To update, log on as an administrator and run this command:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\vsta.exe /HostID SSIS_ScriptComponent /setup
---------------------------

So far to try and fix this I have tried the following:

  • Reinstalling SQL 2008
  • Read through and acted upon a number of similar MSDN posts including this one, this one and this one
  • Removing VSTA (then reinstalling from x86\Setup\trin_aide.msi on the SQL 2008 setup iso)
  • Following the steps in Jason H's blog
  • Doing a repair installation on SQL 2008
  • Running BIDS as administrator
  • Creating a new script task rather than trying to edit an existing one
  • Scouring the registry for "unusual things" relating to VSTA...!
  • Counting to 10

None of which have made any difference.

My setup:

  • Win 7 Enterprise 64bit
  • SQL 2008 standard (client tools) patched up to SP3 (installed from en_sql_server_2008_developer_x86_x64_ia64_dvd_x14-88839.iso)

It might be worth saying that I have seen this problem previously when I installed SQL 2008 the first time on my current pc (same OS and general environment).  I spent about a day on it and did eventually get it working - but (annoyingly) I can't remember what I did.  Either I am now less able, less lucky or less inspired but I'm getting nowhere this time round.  The one thing that rings a bell is HonestDeer's reply to this previous MSDN post (Wednesday, May 11, 2011 3:30 PM).  I seem to remember I changed a reference somewhere to a different version of VSTA and it started working - can't remember the specifics though. 

In case this is relevant: I do have an installation folder for "C:\Program Files (x86)\Microsoft Visual Studio 8" - which contains a version 8.0 of vsta.exe (in the Common7\IDE folder).  This is in addition to the v9.0 version at C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\vsta.exe.  When I initially installed BIDS/SQL, I selected the "Client Tools Backwards Compatibility" option, although deselected this when I came to reinstall it the second time.  NB: all this is following a complete reinstall of Windows 7 - so Visual Studio or SQL client tools 2005 have NOT been installed.

Please help!

Roger.

trim zipcode

$
0
0

Hello!

I am having trouble for some reason with this. Please help...

I have a column in a table called zipcodes where the data is like

'50849-0000' and is nvarchar

I need to modify all the zipcode data to be like this

'50849'

Any ideas?
Thanks!
Mike


Mike Kiser

effect of CSV column order and SSIS package

$
0
0

I have created a SSIS package to import the data from CSV files. The columns of CSV file are mapped with SQL table columns.

But when if I changed the Column order of CSV file it imports wrong data.

My question is if we are mapping the columns Names of CSV file to DTSX package why the change in column order should affect on importing the data?


Thanks & Regards, Vyankatesh Mujumdar

Adding another step in Analysis Service Processing turns all processing to Full

$
0
0

Using Visual Studio 2008, targeting SQL Server 2008 R2.

1. Within SSIS package add Analysis Service Processing task

2. Add processing step to this task (within Processing Settings section) and make it to be an Incremental update of some partition.

3. Save this package and reopen it later

4. Add one more step to the same Analysis Service Processing task.

5. The existing step (created in p.2) automatically turns to Full update. It is not incremental anymore.

Looks like some kind of bug to me. Did anybody see this? Is there any workaround?



SSIS does not show a table that exists in the source database

$
0
0

I have an existing SSIS package that runs in my production environment but does not run in my test environment.  I have restored the relevant database in the test environment from the production environment.  This database has a number of tables.  Using SQL Management Studio I can view all tables and query the data.  In SSIS when I create a data flow task and specify an OLE DB Source, using this database as a source, choose table or view and click the drop down button, there is one table (alphabetically the first table) that is not available for me to choose.  I have logged into the relevant server using a remote desktop and the same login has been used throughout this process.

Any ideas anyone?

Execute SQL Task - Error on Parameter Passing

$
0
0

Hi,

On execution of Execute SQL Taskwithout parameter does not have error..

when i set the parameter User:ItemId - and pass the sql statement SELECT   [COLUMN] FROM [DBO].[TABLE]  WHERE COLUMN_ID = ?

, i get error 

[Execute SQL Task] Error: Executing the query "SELECT   [COLUMN] FROM [DBO].[TABLE]  WHERE COL..." failed with the following error: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

What would be the problem.. where should i check for the fix ?


ShanmugaRaj


Problems with the query, "ResultSet" property not set correctly

$
0
0

I am trying to catch the erros during package execution and i have followed the method as in the given link,

http://www.sqlservercentral.com/articles/SQL+Server/66387/

Here i am not getting any problem actually. i.e. when package fails the errors are properly written to the table created for it separately.

But the execute SQL task control appears to be in red color after package has run. And the error is like below,

[Execute SQL Task] Error: Executing the query "INSERT INTO [<<DAtabase Name>>].[dbo].[ErrorLog]
([Packa..." 

failed with the following error: "Incorrect syntax near 'PK__csod_dat__72399DD10CBAE877'.". Possible 

failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set 

correctly, or connection not established correctly.

I am really tired of searching for its solution. 

If anyone knows it please help me !


--------------------------- Radhai Krish | Golden Age is no more far | --------------------------

Getting "SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED" when set as TransactionOption="Required"

$
0
0

Hi All,

I've very simple ssis package which has sequence container in the Control Flow Then Inside the sequence container i'm using "DataFlow Task".Within the DataFlow Task ( Data Flow) i've 2 data flows , 1 has ADO.NET Source which is reading data from MSSQL DB & pass it to Data Conversion,then it'll update the destination table using ADO.NET Destination.The second DataFlow Task has ADO.NET Source whic read data from MSSQL DB via Sql Command , The Sql query is this

"SELECT EXP_Discounts.* FROM  EXP_Discounts INNER JOIN EXP_DiscountsByLocations ON EXP_Discounts.Id = EXP_DiscountsByLocations.DiscountId WHERE EXP_DiscountsByLocations.LocationId = " + (DT_WSTR, 8)  @[User::LocationId]

I've Int16 variable which i'm using for this query ( EXP_DiscountsByLocations.LocationId is SmallInt DataType Field ),the query is evaluating is successfull & every thing is works fine with TranactionOption="Supported". But the problem is when set to package & sequence container property TranactionOption="Required" it'll giving this warning "SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED" & package is not executing & all stops.

So can anyone encounterd this type error or any suggetion u guys ? :)

Thanks & Regards,


Dimuthu

How can I embed commas with double quotes when exporting .csv file?

$
0
0

Hi, having a bit problem when I am trying to export data from .xlsx file to .csv file.The root cause is because some fields contains comma in the data, and i want to export that kind of cells with double quotes.For example, a cell value is John, Smith. I want export it into csv as "John, Smith" so that when my another application reads this csv file, it won't split the name into two cells.

I noticed if I manually save the .xlsx as .csv in EXCEL, it works perfectly. But in SSIS, the name will be wrote into csv without double quotes. I know I can use Derived Column to embed every cell with double quotes; but it's just NOT COOL and UGLY.

Anybody has any clue if it's a possible mission or not? Thanks.

Viewing all 24688 articles
Browse latest View live


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