I have a performance issue with a Cognos report against SQL Server 2005.
The total running time of the report is 1 minute 15, and using SQL Profiler I found out that 1m13 is spent preparing SQL. Execution and generating the report takes up 2 seconds; no problem there.
The SQL is the same every time I run the report, yet SQL Server spends 1m13 preparing it every single time! I'm no DBA, but as far as I understand that's not what's supposed to happen; once prepared, the SQL should execute quickly every time.
Is there a way to stop SQL from preparing the statement every time?
(Cognos 8 against SQL Server 2005 through OLEDB. Oh, and this query takes about a second when run in EM.)
I would like to prepare a string variable for SQL insertion. Like, replacing all the single quotes with the HTML code equivilent and such. Has anyone written alything like this? Is there a tutorial on the web for it? A control maybe?
I want to prepare insert statements for the data of all tables in my database. I want this to create seed data. Just by using those scripts i can insert the data in another db. Please suggest ho wto prepare in easy way.
Hi. I'm new to SQL and trying to solve this question (I have solved many others, but having problems with this particular one) : there are 3 tables describing voters in america Ballot_box(ballot_box_num,SettelmentID,Street,HouseNum) Settelemnt(SettelmentID,Settelment_name) Voter(ID,voter_name,Adrress,Birth_date,ballot_box_num)
The question is : Write a SQL query that show the names and codes for all settelments that have less than 100 voters.
I have an SSIS project that is deployed to a sql server.
The setup of the project is a parent dtsx package, and many child packages.
The parent executes each of the chid packages.
If I run the parent from BIDS, calling the children that are on the SQL Server, it works fine.
If I execute it from SQL Management Console running on my laptop, connected to the SQL Server, It works.
If I remote into the SQL Server and run it from SQL Agent or SQL Management Console, the job fails with the error:
Error 0xC0202009 while preparing to load the package. SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x%1!8.8X!. for each of the children.
This has quite suddenly stopped working, and I cannot figure out why it will work being executed from my laptop, but not on the server.
This post is for informational purposes only, as I have solved the issue. However, it was such a sneaky issue that I thought I would share.
I was working from home on a working SSIS package. I deployed via dtutil, and then ran it.
It failed immediatly with the error:
"Error 0xC0011008 while preparing to load the package. Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored."
Nothing on the web helped me.
Well, after about 10 hours of working with it I figured it out.
The first package loaded in SSIS is my parent package, which executes other packages stored in SQL Server.
When I first loaded up the package, my VPN was still connecting. Since I was not on the VPN when this package loaded, it could not validate.
Without any indication, my connection to the SQL Server storing the packages was invalid. All I had to do was open it, and click on OK.
So be aware... If the validation cannot take place, bad things can happen ;-)
I have Vista Enterprise 64-bit. I have followed the 3 links in this Answered Link. http://forums.microsoft.com/MSDN/ShowPost.aspx?siteid=1&PostID=2756202
I can turn on the IIS bits under Web Management Tools and Windows Authentication
But when I try to turn on the World Wide Web Services stuff I get "An error has occurred. Not all of the features were successfully changed" and when I click OK it has not turned on any of the fetures under World Wide Web Services.
I have a package which calls another package. It had been working fine for a while. Recently I changed the connection managers' names. Everything in the parent package works fine. Database has been updated correctly. But when it comes to calling the child package it generates :
OnError,CRPRCHMSQCZ,,Execute AMSClientAgentMaintenance,,,3/8/2007 5:49:38 PM,3/8/2007 5:49:38 PM,-1073602332,0x,Error 0x80070002 while preparing to load the package. The system cannot find the file specified. . (there is a period here instead of a file name)
I tested the child package on the server. It works fine. I connected the child package to the Execute Package Task by selecting from the packages on the server. So it is there for sure. Connection manager's name is read from the .dtsConfig. Child package is executed from my development machine but not on the server. I made a small test package just to call this child package, it generates the same error...
I am having problems executing a child package from a parent package using the Execute Package Task. I am attempting to run the master package through a SQL Server Agent job.
The SQL Server Agent job is owned by sa. The step that runs the parent package is configured to load the package from the SSIS Package Store on the same server that the job is running.
I have the Execute Package Task configured as follows:
Location: SQL Server ExecuteOutOfProcess: True Connecting as a SQL Server login (let's say TestEtl)
I have added the db_dtsoperator database role to both the TestEtl login and the login that SQL Server Agent connects through. I have also configured the child package's reader role to include db_dtsoperator. Per http://msdn2.microsoft.com/en-US/library/ms141053.aspx, this should allow these logins to run the child package.
I have enabled logging of all events in both the parent and child packages. I see the following in the logs when the Execute Package Task executes (omitted portions unrelated to the execution of the child package task):
450939 OnPreExecute ChildPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 450940 OnPreValidate ChildPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 450941 OnPostValidate ChildPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 450942 User: Diagnostic ETL 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 ExternalRequest_pre: The object is ready to make the following external request: 'IDataInitialize::GetDataSource'.450943 User: Diagnostic ETL 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 ExternalRequest_post: 'IDataInitialize::GetDataSource succeeded'. The external request has completed.450944 User: Diagnostic ETL 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 ExternalRequest_pre: The object is ready to make the following external request: 'IDBInitialize::Initialize'.450945 User: Diagnostic ETL 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 ExternalRequest_post: 'IDBInitialize::Initialize succeeded'. The external request has completed.450946 User: Diagnostic ETL 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 ExternalRequest_pre: The object is ready to make the following external request: 'IDBCreateSession::CreateSession'.450947 User: Diagnostic ETL 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 ExternalRequest_post: 'IDBCreateSession::CreateSession succeeded'. The external request has completed.450948 OnError ChildPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 Error 0x80070005 while preparing to load the package. Access is denied. . 450949 OnError ParentPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 Error 0x80070005 while preparing to load the package. Access is denied. . 450950 OnTaskFailed ChildPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 450951 OnPostExecute ChildPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 450952 OnWarning ParentPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) 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. 450953 OnPostExecute ParentPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 450954 PackageEnd ParentPackage 2007-06-08 13:35:17.000 2007-06-08 13:35:17.000 End of package execution.
I am sure that what I am doing is quite common, and I obviously have something misconfigured somewhere - but I'm not sure what my misconfiguration is. Can anyone enlighten me?
I cannot execute a package by using Execute Package task. I supplied sa credentials to connection manager, and it shows the list of Packages on SQL Server but when running the task it says
Error 0xC0202009 while preparing to load the package. An OLE DB error has occurred. Error code: 0x%1!8.8X!.
Hi All I am using SQL server Database in one of my table there is a column which is set to Identity=Yes i.e., The ID is increment by one on every insert and if the insertion failed then the id generated goes off then in the next generation it uses new id ..........EXfirst insertion id=1 then in the second insertion if while adding data to other rows if i get some error then the id 2 is not used and when i correct the error and insert it then id=3? can any one give me the solution for this and NextWhen i delete the datafrom the table see the ids are upto 20 and i delete all the records from the table after insertion of new record the id will be 21plese help me in this
I have a snapshot replication is running and now I want to stop the replication for a while. Is it possible to do that? If it is then where I can set to stop it? Please help.
I use EM to handle 2 SQL servers. One I can `stop`; the other I can`t. (except I think I used to be able to do so).
When I select the `stop` I get the following message from EM:
"An error 1051 - (A stop control has bee sent to a service which other running services are dependent on) occurred while performing the service operation on the MSSQLServer service."
How do I track down what this other running service is? How do I stop SQL?
I wanted to remove my Northwind database. But that database is currently used for replication. I'll have to stop the replication first before I can remove it.
Hi, Can anybody tell me how to stop the execution of a T-SQL statement at once? I have tried Alt+Break but its taking a long time to stop.Whats the reason?Plz suggest....I am dealing with a database containing 24343000 data. Joydeep
I have a statement that has been running great for the past hour but now it will not pull the info any longer and just gives me a null
DECLARE @Text VARCHAR(2000) SELECT @Text = COALESCE(@Text + '', '') + x.memotext FROM (SELECT TOP 100 PERCENT memotext FROM customermemoheader WHERE memonumber = 'TERMS' and customernumber = '0009' ORDER BY seqnumber) AS x
SELECT @Text AS MemoText
I have verified in the tables that the info is there by running the select statement from within the (). It has worked for 8000 records and now it no longer works. Any help would be much appreciated.
Hi,I am doing some resource hungry tasks (some extraction and loadingthrough DTS), for which each time the SQL Server Log files gets filledup!Is there any way to stop the logging (like as during restore)?Thanks in advance.-surajit
i'm desperate! I have a application in my SQL Express and only one database for it. But right now it have 3,97gb, without log file. i'm already buying a SQL Enterprise to upgrade this, take some days, but my question is: when this size came to 4,00gb my application will be stop working ? my business stop ???
Error: 0xC0047039 at Load work$$MyDataFile from flat file, DTS.Pipeline: SSIS Error Code DTS_E_THREADCANCELLED. Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown. There may be error messages posted before this with more information on why the thread was cancelled.
Error: 0xC0047021 at Load work$$MyDataFile from flat file, DTS.Pipeline: SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited.
I did not request a shutdown! Someone please give me a global switch to tell SSIS to keep going. Why should I not load 20,00 records because of one bad record?
I have tediously changed every field on every tool to "Ignore Error". Why should I still have to do this? I mean why does SSIS default to failure? Is there some switch I could change in the XML that would change this default behaviour?
The problem with the data in this case: a NewLine character was missing so it looked to the data flow as one very long line.
In one of my packages, I have a script component to do a transformation and I am inserting the output to table. Within that script component, if the data does not match my requirement, I have to stop the job. For that, I am using 'componentmetadata.fireError' to raise an error. The problem is, now even when an error is raised, the job completes by loading the remaining records and then aborts. But I want to abort the job as soon it raises an error. How to do this?
I create a publication with 1 article with a parameterized filter. Empty table without records. Then i went to create a snapshot through snapshot agent. After snapshot was created, data are inserted with "Insert Into..Select" SQL statement. A total of 20 millions records (10GB) are inserted. When i try to sync with a SQL compact edition, the synchronization % stop at 0 for more than 1 hour. Does that mean it is not working?
Hi, The following stored procedure (SP) is using a dynamic sql to build the query. How can this be written using a standard sql. i.e. NOT dynamically being built. Initially I thought I can have something like the following query but it does not seem to be working for when the where caluse parameters are not passed. So I ended up using the dynamic sql as it returns the correct data. Can you see how the SP can be altered please? Thanks
------------------------this query does not return the correct data where the where parameters are not passed.------------ select * from tbl_Management where
([Year] is null or [Year] = @Year) AND (YearPeriod is null or YearPeriod = @YearPeriod) AND (AreaCode is null or AreaCode = @AreaCode)
@Year int = null, @YearPeriod int = null, @AreaCode varchar(3) = null
as
declare @sql varchar(1000)
set @sql = 'select' set @sql = @sql + ' ID' set @sql = @sql + ' ,AreaCode' set @sql = @sql + ' ,Year' set @sql = @sql + ' ,YearPeriod' set @sql = @sql + ' ,A1=A2+A3' set @sql = @sql + ' ,A2,A3' set @sql = @sql + ' ,B1=B2+B3' set @sql = @sql + ' ,X1=convert(int, ((B2+B3)*1.0/(A2+A3))*100)' set @sql = @sql + ' from' set @sql = @sql + ' tbl_Management' set @sql = @sql + ' where'
if (@Year > 0) begin set @sql = @sql + ' [Year] = ' + convert(varchar(4), @Year) set @sql = @sql + ' AND' end if (@YearPeriod > 0) begin set @sql = @sql + ' YearPeriod = ' + convert(varchar(2), @YearPeriod) set @sql = @sql + ' AND' end if (@ProgrammeAreaCode is not null) begin set @sql = @sql + ' AreaCode = ''' + convert(varchar(3), @AreaCode) + '''' set @sql = @sql + ' AND' end
--trim off the last AND... set @sql = left(@sql, len(@sql) - 3)
We have automated the process of backing up and restoring the databases. But the problem is One database is restoring from several hrs ..though it is supposed to take only a few mins. So there is some issue with it and I want to find out how I can stop the restoring process. Its not a command am running in query analyser or Enterprise manager, but its automated so i cant see the command to stop it. Any ideas?