SQL 2012 :: SSIS / Dynamic Updating Of A Recordset Variable?

Jul 8, 2015

updating a recordset contained in an System.Object variable during runtime.

I am trying to execute multiple file actions (plus parsing those files into a set of staging tables) at separate locations in parallel. I know I can do this in C# but I have a business requirement to use SSIS for all ETL operations.

Any one site can have 0 to many of 1 to 3 files. I would like to run multiple sites at the same time, so when all files of all types are completed at that site then go on to the next site in the list. I know I can do a single site at a time in a foreach loop but if I can run lets say 3-5 sites concurrently then I should be able to save execution time.

My thought is to have a recordset of the sites, when any 1 of the 3 (or more) "control flows" is open, update the recordset to let it know that site being actioned, when that site is complete, update the recordset that the site is completed, and so on.Or am I running in the wrong direction?

View 5 Replies


ADVERTISEMENT

SQL Server 2012 :: Table Variable In Dynamic Query?

Jul 2, 2015

I have started working with dynamic queries recently. I am using a table variable and need to add a join in query dynamically.

For Eg- @TableVariable

SET @query_from = @query_from + CHAR(10) + ' JOIN @TableVariable on ABC.ID = @TableVariable.ID '

BUt it gives an error that @TableVariable must be declared

View 8 Replies View Related

SSIS Equivalent For Dynamic Properties Global Variable Example

Apr 17, 2007

Hi,



I have a dts package that currently uses a dynamic properties task to set the values of global variables. Each variable is based on the value of a query to the database.

I am in the process of migrating this dts package to SSIS but cannot find an equivalent function. I have looked at property expressions but cannot get this working the same way.



Any help would be appreciated.



Thanks

Lyn

View 11 Replies View Related

SSIS Dynamic Configuration - Environment Variable Problem

Aug 24, 2007

Dear all,

I have a problem with SSIS reading an environment variable after deploying the packages to a server. I explain.

I have an Parent Packages ETL_MAIN_PACKAGE.dtsx that reads the child packages from a record set and loops on it to execute them with the Execute Package Task task. The first child package to be executed is called DIM_PERIODIC.dtsx.

On my local machine, the Parent Package is configured to read its database connections from an XML file SSIS_configfile.config located on my C: drive. The path (C:SSIS_configfile.config) to this file is stored in the environment variable BI_ETL.

When I run the Parent Package inside SSIS only machine, the connections are read and the package executes perfectly. Now, I want to deploy the packages on our server.

I copied the XML configuration file to the server C drive, I created the same environment variable BI_ETL and set its value to C:SSIS_configfile.config and I rebooted the machine (in case).

The execution of the Parent package is managed by a stored procedure. I use xp_cmdshell command. The command line generated is :


cmd.exe /c dtexec /file "C:ETL_DeploymentETL_MAIN_PACKAGE.dtsx" /CHECKPOINTING OFF /MAXCONCURRENT " -1 " /SET Package.Variables["P_PACKAGE_PATH"].Value;"C:ETL_Deployment" /SET Package.Variables["P_LOOKUP_PATH"].Value;"C:ETL_DeploymentETL_LOGS" /SET Package.Variables["P_SCHOOL_CODE"].Value;"007"

This command generates an error telling that the Environment variable is not found and it throws this error:

Error : 2007-08-23 18:59:10.25
Code : 0x80019003
Sourse : The configuration environment variable was not found. The environment variable was: BI_ETL. This occurs when a package specifies an environment variable for a configuration setting but it cannot be found. Check the configurations collection in the package and verify that the specified environment variable is available and valid.
End Error


Error: 2007-08-23 18:59:10.25

Code: 0xC001401E

Source: ETL_MAIN_PACKAGE Connection manager "Package Path Execute"

Description: The file name "C:ETL_Deployment" /SET Package.Variables[P_LOOKUP_PATH].Value;C:ETL_DeploymentETL_LOGSDIM_PERIODIC.dtsx" specified in the connection was not valid.

End Error

I run the package on the same server with a command line directly in a DOS window:


C:>cmd.exe /c dtexec /file "C:ETL_DeploymentETL_MAIN_PACKAGE.dtsx" /CHECKPOINTING OFF /MAXCONCURRENT " -1 " /SET Package.Variables["P_PACKAGE_PATH"].Value;"
C:ETL_Deployment" /SET Package.Variables["P_LOOKUP_PATH"].Value;"C:ETL_Deplo
ymentETL_LOGS" /SET Package.Variables["P_SCHOOL_CODE"].Value;"007"


I don't have anymore the error saying that the Environment variable is not found, but I still have the same second error :


Error: 2007-08-23 18:59:10.25

Code: 0xC001401E

Source: ETL_MAIN_PACKAGE Connection manager "Package Path Execute"

Description: The file name "C:ETL_Deployment" /SET Package.Variables[P_LOOKUP_PATH].Value;C:ETL_DeploymentETL_LOGSDIM_PERIODIC.dtsx" specified in the connection was not valid.

End Error

I conclude that the environment variable is not read at all.

Does anybody have an idea on how to solve this problem ?

Many thanks.

Sami



View 10 Replies View Related

SQL 2012 :: Creating Dynamic SSIS File Format - Dynamic CSV File As Output

Mar 2, 2014

I am trying to create an ssis package with dynamic csv file as output. and out format contains query output.

sample file name:

Unique identifier + query output + systemdate();

The expression is looking like this.

@[User::FilePath] + @[User::FileName] + ".CSV"

-- user filepath is a variable from ssis package. File name is the output from SQL query. using script task i have assigned the values to @[User::FileName] .

When I debugged the script task the value getting properly but same variable am using for Flafile destination. but its not working.

View 3 Replies View Related

How To Pass Filename As A Dynamic Variable To Flat File Source In SSIS ?

Sep 3, 2007

Hi,

I am migrating one of my DTS package to SSIS.

My task is to read the filename from a database table and transfer the flat file data in to a table.
In SSIS,I am able to fetch the file name using a Data Reader Source; but how to pass this fileName parameter to Flat File Source ?

In DTS I have used ActiveX script to pass filename variable as flatfilecon.Source.
Any help ?

Thanks,
Ravi

View 4 Replies View Related

Updating To ADO Recordset

Oct 26, 2005

Newbie to SQL Server here.

I'm opening a Access 2003 form with a ADO recordset with the following code;


Function SetFloaterDataSource()

Dim RecSourceFloater As String
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

RecSourceFloater = "SELECT tbl_UserVarHSTUFloatStatByEelink.* " _
& "From tbl_UserVarHSTUFloatStatByEelink " _
& "WHERE (((tbl_UserVarHSTUFloatStatByEelink.idCalendar)=" & MyTSCalcIdCal & "));"

'Use the ADO connection that Access uses
Set cn = CurrentProject.AccessConnection

'Create an instance of the ADO Recordset class, and
'set its properties
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = RecSourceFloater
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.CursorLocation = adUseServer
.Open
End With

'Set the form's Recordset property to the ADO recordset
Set WeekDay.Form.Recordset = rs

Set rs = Nothing
Set cn = Nothing

End Function

When I edit the form I noticed that I could not go back to a recently added record because it was not available, so I concluded that I had to force an update, which I do in the before update event of my form, as follows;

'Update the underlying recordset
Me.Recordset.Update

It works great on my test server here, but when I instal it on the SQL Server 2000 - I get an error 'EOF' or 'BOF' is true......... so it fails

Any thougths?

View 1 Replies View Related

Updating A Row In A Recordset

Sep 7, 2007

What properties to you set to make a SQL 2005 recordset updatable?In Access, it'sRecordset.editRecordset!FieldName=SomeValueRecordset.updateAny help is appreciated.

View 1 Replies View Related

Updating An ADO Recordset...

Jun 18, 2007

I'm updating an ADO recordset inside VB6... We just moved the database from SQL Server 2000 to SS2205....

The following code has worked a long-time now when it tries to update the record with SS2205 on the back-end I get a run-time error '3219' Operation is not allowed in this context...



Here is the Open statement...

SampleRecordset.Open "Select * from samplereleased_view", SampleConnection, adOpenDynamic, adLockOptimistic, adCmdText



Here is the line it errors on...

SampleRecordset.Update


Any thoughts on this issue would be great!



Thanks-David

View 2 Replies View Related

SQL 2012 :: SSIS - Updating Source And Target Data Structure

Feb 17, 2015

I have a SSIS package that simply moves data from a SQL database A to another SQL database B. I have update (increased) the size of a nvarchar column, on both A and B.I am wondering if there is a way to "refresh" somehow the SSIS package so I don't have to rebuild and redeploy it.The error I get now is a truncation error: "Text was truncated or one or more characters had no match in the target code page".

View 2 Replies View Related

SQL 2012 :: SSIS - Dynamic Column Mapping

Jul 16, 2014

I am new to SSIS and i got 1 assignment.

Requirement:

In my destination table i am having some 30 columns and the CSV files what i get may have 10 columns or 20. How do I map columns between source and destination dynamically?

View 3 Replies View Related

Current Recordset Does Not Support Updating

Jun 4, 2015

I get the following error when trying to delete a recordset from an SQL Server DB:

ADODB.Recordset
error '800a0cb3' <o:p></o:p>
Current Recordset does not support updating. This may be a limitation of the provider,
or of the selected locktype. <o:p></o:p>
/sqlwishlist/Database2_interface/wishlists1/editor/deletionverified.asp,
line 33

The code is:

<BASEFONT FACE="Comic Sans MS" COLOR="DarkBlue">
<HTML>
<HEAD>
<TITLE>WISHLIST RECORD DELETION VERIFICATION</TITLE>

[Code] ....

View 2 Replies View Related

SQL 2012 :: SSIS Package - How To Get Dynamic Date Files From FTP

Nov 11, 2014

I am working on FTP TASK in SSIS Package. i have to get files from FTP that file names are like 20141110.txt. i want to download any particular date file from ftp. How to i set expression in Remote path?

View 3 Replies View Related

C# With ADO 2.8: Receiving Current Recordset Does Not Support Updating

Nov 17, 2006

Hi All,

I was using VB6 to access a MS SQL Server database. The code worked and works fine. I then decided to migrate the code to C#.Net 2005 using ADO 2.8 (not ADO.Net). Doing that yields with the same exact code the error message, "Current Recordset does not support updating".

I did a whole bunch of Google searches and didn't see anything useful. Mainly the advice from Microsoft and others is to make sure the mode on the connection string is set to "ReadWrite", as the default is "Read Only" and to make sure to set the lock type to either optimistic or pessimistic. Still others said that the code should set the CursorLocation property of the recordset.

I can safely say that I have been setting the mode to "Read/Write" since the start and have played around with the lock type, cursor location, and open method. Nothing works on C#, BUT VB6 is so totally happy with everything.

The provider works fine, as VB6 works fine, and the lock type is also fine, so therefore the built in suggestions do not apply.

My code is:


// Connection string template. Filled in properly in real code.
strConnect = "Server={0};Database={1};"

// Set the connection properties.
this.SQLConnection.ConnectionString = strConnect;
this.SQLConnection.Provider = "SQLOLEDB";
this.SQLConnection.Mode = adModeReadWrite;

// Open the connection.
this.SQLConnection.Open(strConnect, strUserName, strPassword, -1);

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

// Create the ADO objects needed.
dbRSAdd = new Recordset();

// Open the recordset.
dbRSAdd.Open(strTable, dbCatalog.ActiveConnection, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic, (int)CommandTypeEnum.adCmdTable);

// Cycle through each record to add.
dbRS.MoveFirst();
for (lRecord = 0; lRecord < dbRS.RecordCount; lRecord++)
{
// Add a new record.
dbRS.AddNew(System.Reflection.Missing.Value, System.Reflection.Missing.Value);

...
}

// NOTE: The code crashes with the call to 'AddNew'.



Any advice?

View 1 Replies View Related

SQL 2012 :: SSIS Variable Connection Manager

Sep 2, 2014

I have a table which contains a column ([Connection String]) that has every connection string for the SQL instances on our estate.

I have a package which will import data from a single instance, but how do I set the connection manager so that it uses a variable and is populated by a selecting the connection strings from my central database?

Do I use a cursor to select the next connection string?

View 9 Replies View Related

SQL 2012 :: SSIS - How To Pass A Value In Parameter To Variable

Sep 17, 2015

How do you pass a value in a parameter to a variable ?

View 2 Replies View Related

SQL Server 2012 :: How To Use Table Variable In SSIS

Sep 30, 2015

How to use table variable in SSIS 2012, is it possible to use table variable in SSIS.

I want to insert some results from EXECUTE SQL TASK to this table variable and use this variable in OLEDB SOURCE task in data flow where it is used in SQL query with IN Operation.

The table variable contain multiple values like '100','234','XYZ' Is it possible to do or is there any other solution to achieve this?

View 2 Replies View Related

Current Recordset Does Not Support Updating. This May Be A Limitation Of The Provider

Mar 25, 2004

I keep getting this error when I try to update

Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.

It worked fine in Access, but when I switched to SQL Server it stopped working.

Can someone help! Please!

thx

Justin

View 11 Replies View Related

SQL Server 2008 :: ODBC Error Updating A Recordset

Jun 15, 2015

I am getting an error (number -2147217887, error message "ODBC--call failed.") when I try to execute an rst.Update. I have an MS Access 2013 application using an ODBC connection to SQL Server 2008 r2. I am using a query to update a table. It is a simple Select query with no joins. I have checked to make sure the table can be updated.

I was not sure if there were any special permissions that I need to set to allow a linked table to be updated in MS Access this way?

View 4 Replies View Related

SQL Server 2012 :: Read Dynamic Columns From Excel File Into SSIS

Nov 11, 2014

I have an excel file which has dynamic columns

i.e. Col1, Col2, Col3 this week. next week i will have a new Col4 in the sheet. This will keep on adding every week.

My problem is to Unpivot the data

Date 8/2/2013 8/9/2013 8/16/2013

Stock 1,561 1,661 1,761

i.e. the abobe table should become as

Date Stock

8/2/2013 1561
8/9/2013 1661
8/16/2013 1,761

How can I unpivot the dynamic columns given that the columns will keep on increasing every week.

View 1 Replies View Related

SQL 2012 :: Set SSIS EvaluateAsExpression Property Of Variable To TRUE?

Jul 23, 2015

Where do you set an SSIS EvaluateAsExpression property of the variable to TRUE?

[URL]

View 3 Replies View Related

SQL 2012 :: SSIS - Import Date As Variable From Excel File

Feb 5, 2015

I am using vs 2010 and I have an .xls file that I am trying to import into SQL Server 2012, and I have most of it figured out, but I have a date field that is giving me problems, and what I would like to do is put that date in a variable so I can add it to every record in my SQL Table.

I am using a SQL Task Editor with an excel connection and I have no problem getting other data from the excel document and putting into my variable, its just the date that I have problems.

View 0 Replies View Related

Integration Services :: Edit Project Param Variable Value In SSIS 2012

Jul 7, 2015

I have declared one variable in Project param with some value.

I want to edit that varaiable through Script task using C# / VB code.

Looking for C#/VB code which needs to be used in Script task to edit project param level variable[not for package level variable].

View 3 Replies View Related

Integration Services :: Cannot Create Date Type Variable In SSIS 2012?

Oct 6, 2015

As part of my package, i require a date (Only date, not DateTime) which is 10 months previous to get date.Eg: for today if the package executes, then i want 12/1/2014 , which i will use in my package as a filter like 'where date='?' where ? is a paramter which is is derived from the above logic

So, I have a project parameter @ppdate with value as  -10. I create a variable with DateTime (because there is NO date type for SSIS) and gives the expression as below

dateadd("Month",@ppdate, DATEADD("D",-(DAY(GETDATE()))+1,GETDATE())) , I am getting '7/1/2011 11:33:38 AM' which i don't want - i want only '12/1/2014'. How can i get it?

To get '12/01/2014',  If i change the variable from DateTime to string, then i think i cant use the value in the filter condition like ''where date='?' because this does not accept string. Is this correct?

View 3 Replies View Related

Transact SQL :: Return Recordset From Dynamic Table

Sep 25, 2015

I tried to create a dynamic table, fill in it and return it as recordset. The codes as this:

Declare @tbl Table(id int, name varchar(100), age int) 
Insert Into @tbl(id, name, age)
Values(1, 'James, Lee', 28),
   (2, 'Mike, Richard', 32),
   (3, 'Leon Wong', 29)
Select * From @tbl Order By age

It works well in "SQL Query Ananizer". But return no records in ASP page.

View 5 Replies View Related

Return Recordset And A Variable From Procedure

May 28, 2005

Hi

I want a functionality such that I want to return a select query resultset and a varchar variable from a procedure. How can I achieve that,and moreover how can I fetch them in ASP??

Waiting for someone to shed a light of hope.
Thanx a lot

View 1 Replies View Related

Multiple Reads Of User Variable (Recordset Object) Failing

Mar 1, 2007

I hope this is a simple question. I have a package-scope user variable which is populated using a Recordset Destination in a Data Flow task. I am attempting to read the variable multiple times from different Script Tasks. The first read works fine, however the second read, in the second Script Task, says that there are no rows.

Has anyone run across this before? Any thoughts would be appreciated.

Thanks





View 1 Replies View Related

SSIS Recordset

Jan 18, 2006

Hi,
Can anyone tell me how can i remove records from a recordset through an IS script?
Also how can i write some records to an excel file from a script as well?

Thanks guys..

View 2 Replies View Related

Dynamic Updating Of Parameters.

Sep 5, 2007

Hi I am using sql server reporting services 2000 and in a report I have more than 20 parameters of data type Boolean. I want another parameter drop down which have "select all" and "clear all" options. When user select €œselect all€? option from the parameter list all 20 parameters value should be false.

I will be very thankful.

Regards,
Faisal Saleem

View 5 Replies View Related

Dynamic Filter Not Updating Correctly

Apr 14, 2006

I have several SQL Mobile devices (WM5) syncronizing with a SQL 2005 database through merge replication. We are using the HOST_NAME parameter to filter several tables. A few of these filters use a sub-query to filter the data because of the complexity of the filter (need to do more than join to one table). The subquery will use the HOST_NAME parameter. For example, I want to get a list of all users in the current user's company I need to use host_name to get the current user, find their company ID, then filter the user table on that company ID.



Everything works fine until a user is removed from the table. In that case, the delete statement is not replicated to the device until they reinitialize the mobile database.



Thanks for the help!!

Mike

View 5 Replies View Related

Why Isn't This Variable Updating?

Jul 20, 2005

Hi;I have a sqlserver database with a field that is of TEXT datatype (not my decision) that is used to store comments from users on one ofour websites.For various reasons I need to make code that will clean the text inthis field( for example purposes mytable.comment ) so that there are no singlequotes in it.I am experiementing with making mytable.comment a mix of 'B' and 'Q'such that all 'Q's are replaced with 'B's.The code below works.......once.If I run it more then once no further 'Q's will get replaced.The problem is with the @index variable I am using that tellsUPDATETEXT where to update.It isn't changing.Any ideas would be greatly appreciatedSteve------------------------------------------------------------------------DECLARE @ptrBlurb varbinary(16), @index intselect @ptrBlurb=TEXTPTR(comment), @index=PATINDEX('%Q%',comment)frommytablewhere PATINDEX('%Q%', comment) <> 0 andprojid = '00013'UPDATETEXT mytable.comment @ptrBlurb @index 1 'B'select projid, comment from mytable-------------------------------------------------------------------------

View 5 Replies View Related

Updating The Variable's Value

Jul 29, 2007

Hello People,
I'm using SSIS and I want to send a report to the admin about how many rows are new, updated or unchanged in a mail. Everything is working fine except that the values that are sent are always zeros. I'm using a Row Count Transformation and configuered it to update the approperiate User Variable which I priviously created. However, the initial values in these variables are always Zeros. What can I do?
Thanks,
SHIKO

View 12 Replies View Related

Error Updating Dynamic Datagrid With SQL Server

Jun 29, 2007

Hello, I have a datagrid which is populated with data from an MS SQL server database. When I run an update query it always throws an exception - what is the most likely cause for this given that I am using the code below:  1 public void DataGrid_Update(Object sender, DataGridCommandEventArgs e)
2 {
3 String update = "UPDATE Fruit SET Product = @ID, Quantity = @Q, Price = @P, Total = @T where Product = @Id";
4
5 SqlCommand command = new SqlCommand(update, conn);
6
7 command.Parameters.Add(new SqlParameter("@ID", SqlDbType.NVarChar, 50));
8 command.Parameters.Add(new SqlParameter("@Q", SqlDbType.NVarChar, 50));
9 command.Parameters.Add(new SqlParameter("@P", SqlDbType.NVarChar, 50));
10 command.Parameters.Add(new SqlParameter("@T", SqlDbType.NVarChar, 50));
11 command.Parameters["@ID"].Value = DataGrid.DataKeys[(int)e.Item.ItemIndex];
12 command.Connection.Open();
13
14 try
15 {
16 command.ExecuteNonQuery();
17 Message.InnerHtml = "Update complete!" + update;
18 DataGrid.EditItemIndex = -1;
19 }
20 catch (SqlException exc)
21 {
22 Message.InnerHtml = "Update error.";
23 }
24
25 command.Connection.Close();
26
27 BindGrid();
28 }
 All of the row types in MS SQL server are set to nvarchar(50) - as I thought this would eliminate any inconsistencies in types. Thanks anyone 

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved