Prevent Simultaneous Package Executions
Oct 23, 2007
How can I prevent a package, or a section of a package, from being run more than once simultaneously? The package makes use of a staging database table, and if two copies of this package are run at the same time, there will be a race condition and possible corruption of the data in the database table. I have also noticed that the SSIS logging gets messed up and starts overwriting itself if I have more than one of these packages run at the same time.
What I am thinking of should work the same way as a serializable transaction lock on a normal query, where one query has to wait if another query has a lock on the table. I don't want the package to throw an error, I want it to wait until the other one is done.
I have been trying to use transactions in a test SSIS package, but they are not quite doing what I want them to do. I put various SSIS steps in a sequence container and require a serializable transaction. I have also tried putting the transaction at the package level, but that is not preventing simultaneous package runs.
Is there a built-in way to do this that is easy to implement? Otherwise, what I could do is insert a flag into the database indicating that a package is running, then make sure to reset the flag on any error or on completion. It seems like this alternate method could be error-prone though.
I am using SP2.
View 8 Replies
ADVERTISEMENT
Dec 17, 2006
Hi,
I have a file-deployed package which I need to call N times at once using DTEXEC. When I attempt to execute N instances of the package, the second instance doesn't execute. I can execute different packages at the same time, but never the same package more than once. Does anyone know how to get this scenario working? Just to clarify a bit more - I can call the package as many times as I like as long as I wait until the previous run of DTEXEC is finished. Please help!
Thanks,
dcb99
View 2 Replies
View Related
Dec 12, 2006
After fine-tuning my package logging, I built a query against SYSDTSLOG9 that uses the combination of the OnPreExecute events and any subsequent event for each task to build a nice view of a package in progress, including the duration of each event. (Running tasks would have a row with a NULL EndTime.)
When running the package within the Designer, everything works as expected. Events are logged at the task level and everything bubbles-up to the package level.
However, when I run the package from SQL Agent (using the SSIS job step), none of my OnPreExecute or sub-component events are written. That is, I only get package-level OnInformation, OnPostExecute and OnError events.
This means when the job/package is executing, I can't directly see which steps are currently in progress nor can I get a duration for each step once it's completed. This will be very disconcerting for my teammates who will have to help support this at some point.
Any idea how or why there would be a change in behavior between these two execution methods?
Thanks in advance for any help. Until then, banging my head against the wall...
Tim
View 8 Replies
View Related
Jul 26, 2007
Hello
I am trying to call the same package with different starting parameters using asynchronous method calls.
My code is
namespace ReconHost
{
public partial class HostContainer : Form
{
public delegate void InvokePackageHandler(
Microsoft.SqlServer.Dts.Runtime.Application app,
int var
);
Microsoft.SqlServer.Dts.Runtime.Application app;
public HostContainer()
{
InitializeComponent();
for (int i = 0; i < 2; i++)
{
app = new Microsoft.SqlServer.Dts.Runtime.Application();
InvokePackageHandler asyncInvokePackageHandler = InvokePackage;
asyncInvokePackageHandler.BeginInvoke(app, i, null, null);
}
}
public void InvokePackage(Microsoft.SqlServer.Dts.Runtime.Application app, int var)
{
Package pkg = app.LoadPackage(@"c:GRSGRSGRSTest_Async.dtsx", null);
pkg.Variables["intVar"].Value = var;
pkg.Execute();
pkg = null;
}
}
}
If I set the for loop to loop just once, the package is executed fine. Any more than once and only one instance of the package is executed.
Does anyone know what I am doing wrong? I know it is possible to execute the two package instances simultaneously because you can use DTexecUI.exe on two clients to do this.
Thanks in advance
Tomo
View 3 Replies
View Related
Feb 18, 2004
I've created a DTS package -- that uses a query to export to a .txt file. My question is -- if the results of this query are zero (no results returned within the package ) -- how can I tell the package not to export a zero byte file. Any thoughts on that? Any help you could give would be greatly appreciated. Thanks!
View 3 Replies
View Related
Jan 26, 2007
I am getting the ubiquitous error....
"The statement has been terminated.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
I have a stored procedure that performs a task on a loop. Sometime it fails, somtimes it succeeds and that's just fine, the errors are handled within the stored procedure and I return counts of success and failures.
The trouble is that the package execution terminates when even one of the task fails. I don't want it to, I just want it to continue as the pakage should then go on to extract the source of the failues and post them back where they came from.
Any ideas how I can achieve this?
I have tinkered with the MaximumErrorCount setting, but I get the same result regardless of whether this is set to 0, 1, or 99999.
I also have a 'failure' path leading from the SQL task, but the package does not follow it.
I'm using an OLE DB connection and when none of the tasks fail, the process works perfectly.
Any ideas, most appreciated.
View 8 Replies
View Related
Jul 24, 2015
I have an SSIS and SSAS project in the same solution. Â I need to debug the SSIS package regardless if there is an error or two in the SSAS project. Â Is there a way to ignore the SSAS project while I debug the SSIS package?
View 2 Replies
View Related
Jun 22, 2007
I have a weird situation. I have migrated some DTS packages from a sql 7.0 server to SQL2005. One of them works as a DTS package but fails under the job sections with an error saying could not connect to the database server. I have no option but to rewrite the whole package in SSIS(which I hate).
Any ideas.
Regards
Paresh Motiwala
Boston, USA
View 2 Replies
View Related
Jan 30, 2008
Hi,I'm looking for a way to log exactly which sql queries are executed on a specific asp.net page request. Actually I'm not looking for anything advanced here, just a log which writes all the queries to a text-file would be good enough for me. Does anyone know of a tool for visual studio that could help me with this or is there a way to build a logger like this by hooking into ADO.NET in some way? This would help me out a whole lot now as I with this log could see that my cache logic really is working as it should. thanks!
View 4 Replies
View Related
Oct 25, 1999
I'm looking for a facility similar to NT audit facility except for SQL Server 6.5.
Is there a tool or facility that will track when users log in (using SQL Server security), and either which stored procedures they execute or which tables they select?
View 1 Replies
View Related
Dec 29, 2014
I'm looking for feedback on a query I've devised to return a numeric value if the 3 most recent executions of a job have failed. The purpose of the query is to server as a custom counter alert for Idera SQL DM, and by definition an SQL Script alert must return a numeric value.
My environment is SQL Server 2008. Note that the job name is hard coded.
;WITH CTE_Restore_JobHistory AS
(SELECT h.[job_id]
,j.[name] as JobName
,h.[message]
,h.[run_status]
[Code] .....
View 2 Replies
View Related
May 3, 2008
basically, is it inefficient to open and close a data connection everytime data needs to be retrieved or is there a way for a user to use the same conenction over multiple pages orfor multiple users to share one global data connection I just wanted to know this before I built a site where data could be constantly being pulled or put into the database.It would be easier to just keep opening and closing the connection since it just means pasting in the small chunk of code I use to do that where I need it. I hear speak of connections sometimes not closing etc and wonder if that is an issue then if you are opening and closing too many of them. I am using SqlConnection SqlCommand and SqlDatareader , my code works, just wondering if my approach lacked scalability before I find out too late and have to rewrite everything . Jim
View 11 Replies
View Related
May 2, 2006
If multiple snapshots for the same report attempt to generate at the same second, is there something in place to prevent them from conflicting with each other?
Our SSRS 2005 application will use a console app that we are writing to change the default parameters on each report and call the CreateReportHistorySnapshot method. This application will be multi-threaded, so there is a possibility that multiple versions of the same report with different parameters will attempt to run at the same time. We need to be sure that these snapshots will not conflict and return the appropriate SnapshotHistoryID for that report run.
From looking at the History table in the ReportServer database it looks like there are uniqueIDs and other keys that would prevent duplicates, but what if the requests come in at the same time? Is SSRS 2005 smart enough to delay for a second so that there is not a duplicate? Since the way you reference these snapshots in your URL is with the Snapshot Time in UTC format, that only goes out to full seconds (2006-05-02T00:00:00).
Sorry for the length, but I could not think of how to condense this.
Thanks,
Steve
View 4 Replies
View Related
Mar 12, 2006
I have C# Express and the SQL Express Management Studio CTP installed. So far, I've been forced to disconnect from the server in one app to connect to it in the other. I understand there is something around a 4 connection limit in SQLServer Express, so I don't see the problem.
During one of these episodes, SQL Mgmt Studio hung while opening DB properties, then the SQLServer service couldn't be stopped. Now the DB can't be opened even after a reboot.
Help?
View 10 Replies
View Related
Mar 29, 2000
How can I simulate 1,000 simultaneous users in my database?
View 3 Replies
View Related
Mar 22, 1999
Is there a limit to the # of tasks ( Dumps) to a HD device ,which SQL 6.5 can perform simultaneously?
View 1 Replies
View Related
Oct 22, 2007
Hi,
I have an application resource that is accessible from multiple clients applications that all have access to a common SQL Server db. By this, I mean, multiple clients can potentially connect to this resource at any given time. I want to limit the usage of this resource to one client at a time and was thinking about simply using SQL to maintain the name of the client that currently has "control" of the resource.
My question pertains to the case where two clients are executing a SQL query, simultaneously, to check whether someone has control of the resource or not. If two users were to simultaneously execute this query, do i have to lock the table in order to ensure that both users are not viewing data in an incorrect state? Or, does SQL Server ultimately execute the queries in a specific order? Meaning, the requests are simultaneous from a human standpoint but one request may have actually come in a millisecond before the other one and SQL server executes that query first, and then the second query. Is this how it works?
Thanks,
Paul
View 2 Replies
View Related
Feb 14, 2008
Hi All,
I have a Windows 2003 Server. Planning to use SQL Server to act as the main Database Server which needs to cater to over 100's of simultaneous connections.
Can anyone share with me the default maximum simultaneous connections and the maximum allowed simultaneous connections for the following versions:
- MSDE
- 2000
- 2005 Express
- 2005
Hope I can get more professional advice from you guys.
Thanks.
View 1 Replies
View Related
Jul 11, 2006
Using the Import/Export Wizard, it is easy to set up SSIS jobs to import multiple tables in one task. However, SSIS appears to grab a connection to the source database and the destination database for each table indicated in the task sometime prior to doing the actual data transfer. Even though the transfer seems to be done a few tables at a time, all the connections are held throughout the execution of the task.
This has two effects:
1. The task may fail if the number of connections exceeds the limit of user connections set for the database
2. There is a severe impact on the other users of the databases (in my case, the source is a production system)
Is there any way to control the number of simultaneous connections that SSIS data transfer packages initiate?
I can, of course, define the package to have a small number of tables (thus limiting the connections), but in real life I need to transfer almost 700 tables, so limiting the number of tables per task to 20 or 25 produces an awkwardly large, and error prone, number of tasks. And since this definition must be done for multiple (not quite identical) databases, the extra effort of defining small collections of tables is signifcant.
View 4 Replies
View Related
Aug 14, 2007
Greetings!
Are there any limit of simultaneous users and/or connections when running SQL Express? The free license of SQL Express, does that include use by any number of users/devices?
Regards
Harald Hedlund
View 5 Replies
View Related
Apr 7, 2008
Hi, can anyone help me? I want to know whether is it possible to insert records simultaneously in both master & detail tables?
For elaboration, say there is a master table contains (orderid,orderdate,amount) and details table contains (orderid, productid,qty,price). 1 record of master table associated with n records of details table. Can it be possible to insert both the 1 record at master table with n records in details table in a single sql statement?
View 3 Replies
View Related
Jul 20, 2005
hello to all,there are two databases named A and B.One database contains employee id as primaryI have another project database which includes that employee id asforeign key. How can I reflect my updations,deletionsthank you in advance,vishnu
View 2 Replies
View Related
Oct 15, 2007
Is there a way to get the Report Manager to allow a single user to
execute more than 1 report at a time? Currently, each user can only
have a single report being executed at a time. It looks like any
other reports are being queued and executed serially.
View 1 Replies
View Related
Feb 8, 2007
I am trying to insert into two tables simultaneously from a formview. I read a few posts regarding this, and that is how I've gotten this far. But VWD 2005 won't let me save the following stored procedure. The error I get says “Incorrect syntax near ‘@WIP’. Must declare the scalar variable “@ECReason� and “@WIP�.� I'm probably doing something stupid, but hopefully someone else will be able to save me the days of frustration in finding it. Thanks, the tables and procedures are below.
I made up the two tables just for testing, they are:
tbltest
ECID – int (PK)
View 2 Replies
View Related
Mar 30, 2001
Hi,
could somebody please let me know what is the maximum number of simultaneous users/connection per single SQL Server 7.0 box? Licenses are not the issue here, rather the number of physical connections supported before another server needs to be purchased.
Another variation of this question would be what's the highest number of databases that 7can be created on SQL 7.0 server and what is the highest number of physical connections supported per database? Again, licenses are not the issue. Thanks a lot in advance.
View 2 Replies
View Related
Sep 28, 2007
I was going over this article , and was intrigued by this statement "If SQL Server 2005 Express is running on Windows XP Home, it is limited to five simultaneous connections. If it is running on Windows 2000 or Windows XP Professional, it is limited to 10 simultaneous connections. However, these are limitations of the operating system and not of SQL Server 2005 Express."
What are simultaneous connections? Is this related to Max worker threads defined as 255 on other editions? How does underlying OS impose how many connections can be done to SQL server. And finally how many simultaneous connections can be done in Windows Server 2003?
View 11 Replies
View Related
Jul 30, 1998
Hi everyone!
Is it possible to control the number of simultaneous connections one login id can have?
I`d like to avoid my users to share their login ids and passwords to help them enter data into the system.
Thanks,
Mauricio
View 5 Replies
View Related
Dec 1, 2005
Hello everyone, I am hoping someone can help me with this problem. Iwill say up front that I am not a SQL Server DBA, I am a developer. Ihave an application that sends about 25 simultaneous queries to a SQLServer 2000 Standard Edition SP4 running on Windows 2000 Server with2.5 GB of memory. About 11 of these queries are over views (all overthe same table) and these queries are all done from JDBC but I am notsure that matters. Anyway, initially I had no problem with thesequeries on the tables and the views with about 4 years of information(I don't know how many rows off hand). Then we changed the tables toreplicated tables from another server and that increased the amount ofdata to 15 years worth and also required a simple inner join on 2columns to another table for those views.Now here is the issue. After times of inactivity or other times duringthe day with enough time between my test query run I get what lookslike blocking behavior on the queries to the views (remember these allgo to the same tables). I run my 25 queries and the 11 view queriesall take about 120 seconds each to return (they all are withinmilliseconds of each other like they all sat there and then werereleased for processing at the same time). The rest of the queries arefine. Now if I turn around and immediately run the 25 queries again,they all come back in a few seconds which is the normal amount of time.Also, if I run a query on one of views first (just one) and then runthe 25 queries they all come back in a few seconds as well.This tells me that some caching must be involved since the times are sodifferent between identical queries but I would expect that one of thequeries would cache and thus take longer but the other 10 would befast, not all block for 2 minutes. What is more puzzling is that thisbehavior didn't occur before where now the only differences are:1) 3 times more data (but that shouldn't cause a difference from 3seconds to 120 and all tables have been through the index wizard with aSQL trace file to recommend indexes)2) There is now a join between 2 tables where there wasn't before3) The tables are replicated throughout the day.I would appreciate any insight into this problem as 120 seconds is waytoo long to wait. Thanks in Advance.Chris
View 1 Replies
View Related
Mar 30, 2007
Hi everyone. I hope that my question isn't too broad, but here it goes...
I am trying to figure out the best way to scale a SQL Server database so that it can handle a billion simultaneous users querying the same tables, and can easily scale to handle many billions of simultaneous users. The database must also have 999.99% availability. The number of licences and amount of hardware needed is not an issue.
Thanks in advance.
View 15 Replies
View Related
Jul 27, 2006
Hi Everyone,
I have a software solution that consists of two separate applications that share a SQL Server Express database on a single computer. Everything is working great, except when both of the applications want to access the database at the same time. All I can find is information on configuring multi-user access in a distributed system. I'd appreciate any information on configuring multi-application access on a single computer.
Thanks,
Mike
View 4 Replies
View Related
Mar 20, 2007
Hello, I have one store procedure that writes something data to one physical sql table 'MyTable' and on beginning I first call:DELETE FROM MyTableProcedure returns at the end data from 'MyTable' as on SELECT. PROBLEM:I started SQL Manager on my Laptop and on Computer near me and all pointed to same database (on Server) and I run that procedure simultaneously on Laptop and Computer at the same time (two hands on F5 button on these computers). Occasionally when clicking with both hands at the same time I got no records at the end of execution (on both computers), otherwise I got the results.WHAT I THINK IS PROBLEM:Somhow one SP start working and it did not come to the end and another computer called this SP and execute first command (DELETE FROM MyTable) and I got empty records at the end..WHAT I NEED:I need to prevent this situation to get empty records. All computers must get these records always. How I can use some sort of LOCKs to do this?Or to do that on C# application level using LOCK command? Thanks in advanceAleksandar
View 2 Replies
View Related
Jan 21, 2007
I am building my first ASP.Net app from scratch and while working on the DAL I came across the problem of SQL Injection. I searched on the web and read different articles but I am still unsure about the answer. My question is should I add
db.AddInParameter(dbCommand, "AvatarImageID", DbType.Int32, avatarImageID);
Add in Parameters to my C# code to avoid SQL Injection. What is the best practice. I am unclear if the stored procedure already helps me avoid SQl Injection or if I need the add in parameters in the C# methods to make it work. I need some help. Thanks, Newbie
My C# update method in the DAL (still working on the code)
private static bool Update(AvatarImageInfo avatarImage)
{
//Invoke a SQL command and return true if the update was successful.
db.ExecuteNonQuery("syl_AvatarImageUpdate",
avatarImage.AvatarImageID,
avatarImage.DateAdded,
avatarImage.ImageName,
avatarImage.ImagePath,
avatarImage.IsApproved);
return true;
}
I am using stored procedures to access the data in the database.
My update stored proc
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[syl_AvatarImageUpdate]
@AvatarImageID int,
@DateAdded datetime,
@ImageName nvarchar(64),
@ImagePath nvarchar(64),
@IsApproved bit
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
BEGIN TRY
UPDATE [syl_AvatarImages]
SET
[DateAdded] = @DateAdded,
[ImageName] = @ImageName,
[ImagePath] = @ImagePath,
[IsApproved] = @IsApproved
WHERE [AvatarImageID] = @AvatarImageID
RETURN
END TRY
BEGIN CATCH
--Execute LogError SP
EXECUTE [dbo].[syl_LogError];
--Being in a Catch Block indicates failure.
--Force RETURN to -1 for consistency (other return values are generated, such as -6).
RETURN -1
END CATCH
END
View 2 Replies
View Related
May 21, 2008
Have a job that calls a DTS package, DTS is an Export & Import wizard to copy tables. Someone deleted a table from source and my job failed last night. Inputs appreaciated.
View 12 Replies
View Related