I have around 20 reports in an ASP web-application which connects to a
SQL Server 2000 dB, executes stored procedures based on input
parameters and returns the data in a nice tabular format.
The data which is used in these reports actually originates from a 3rd
party accounting application called Exchequer. I have written a VB
application (I call it the extractor) which extracts data from
Exchequer and dumps the same into the SQL Server dB every hour. The
running time for the extractor is an average of 10 minutes. During
these 10 minutes, while the extractor seems to run happily, my ASP
web-application which queries the same dB that the extractor
application is updating becomes dead slow.
Is there anyway I can get the extractor to be nice to SQL Server and
not take up all its resources so that the ASP web-application users do
not have to contend with a very very slow application during those
times?
I am using a DSN to connect to the dB from the server that runs the
web-application and well as the other server which runs extractor.
Connection pooling has been enabled on both (using the ODBC
Administrator). The Detach Database dialog gives me a list of open
connections to the dB. I have been monitoring the same and I have
noted 10-15 open connections at most times, even during the execution
of extractor.
All connection objects in the ASP as well as VB applications are
closed and then set to nothing.
This system has been in use from 2002. My Data file has grown to 450MB
and my Transaction Log is close to 2GB. Can the Transaction Log be a
problem. For some reason, the size of the Transaction Log does not go
down even after a complete dB backup is done. Once a complete dB
backup is done, doesn't the Transaction Log lose its significance and
can be actually deleted? Anyway this is another post I'm doing today
to the group.
In the extractor program,
1) I create a temporary table
2) I create an empty recordset out of the table
3) I loop through the Exchequer records using Exchequer's APIs, adding
records into the recordset of the temporary table as I go along.
4) I do an UpdateBatch of the Recordset intermitently
5) I open an SQL Transaction
6) I delete all records from the main table
7) I run a INSERT INTO main_table SELECT * FROM #temp_table
8) I commit the transaction
I have a problem running a batch file, now the problem is that when i run the batch file the command prompts the user for an input, but I have all the output of the bat file going into a log file. So when i run the bat file the process just sits there until i hit the 'y' key or unless i nput sumthin manually. This is a problem becuase this batch file is running on the UAT server as a job and there is no one there to input once the job is running. The commnd in the batch only requires an input once a month.
for eg if run: launch_scrt.bat and i want to put sum parameters such as 'y' or 'n' to avoid the manual input once the job is running. Any ideas?
I have tried asking the same question in other forums. All i get is links
Please help me. I have the following requirement:
I have the following tables: Theater - TheaterId, TheaterName, Revenues,locationid, stateid State - StateId, StateName Location - LocationId, LocationName, StateId
I want to generate reports that will tell me the revenue generated for each theater in each location in a state. I want to run a batch process which will loop through the 3 tables and will passing the location and state id as parameters one by one. I want each report to be generated as a pdf and stored in a location. How do I do this?
I have a SSIS package with the last three tasks in the control flow are stopping the SSAS, then "on success" the second last task is execute a batch file to copy a bunch of files to a remote server using the robocopy command, then "on success" the last task is to start the SSAS. I test all three tasks individually and they are all working fine. The problem is in-between the second last task and the last task, the second last task is to execute a batch file and then forward to the last task. The task just moved to the last task once the batch file is executed and it did not wait until the actual robocopy job is completed. Therefore it caused a problem in the robocopy process. Thanks.
I have an "execute process" task which executes a perl script. When I run the task, it shows a prompt with the message "the publisher can not be verified". It gives the option to continue the task or to cancel.
The problem for me is that I want to schedule this package to run automatically, and I don't want the automated process to show this dialog. I need to override the security setting and have SSIS execute my batch scripts without prompting. Assuming I don't want to rewrite the Perl code into a script task, is there a way to do acomplish this?
Trying to run a SSIS package from a SQL job, and the package itself has a step that calls a process task that runs a batch file. The syntax in the process task I have is the following:
executable: c:windowssystem32cmd.exe Arguments: /C e:SungardPTAencryptfile.bat Working Directory: e:sungardpta
I keep getting the following in my log:
PackageStart,MIMKEIMC11N,MI rustserviceadmin,PTADailyTransactionExtract,{46F7381F-B345-47DC-BFC0-17CCF02A935A},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:11 PM,1/29/2008 1:59:11 PM,0,0x,Beginning of package execution. OnError,MIMKEIMC11N,MI rustserviceadmin,EncryptFiles,{FCF5B653-CC05-4183-981B-F5EF4906DD09},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:12 PM,1/29/2008 1:59:12 PM,-1073573551,0x,In Executing "c:windowssystem32cmd.exe" "/C e:SungardPTAencryptfile.bat" at "e:sungardpta", The process exit code was "1" while the expected was "0". OnError,MIMKEIMC11N,MI rustserviceadmin,PTADailyTransactionExtract,{46F7381F-B345-47DC-BFC0-17CCF02A935A},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:12 PM,1/29/2008 1:59:12 PM,-1073573551,0x,In Executing "c:windowssystem32cmd.exe" "/C e:SungardPTAencryptfile.bat" at "e:sungardpta", The process exit code was "1" while the expected was "0". OnTaskFailed,MIMKEIMC11N,MI rustserviceadmin,EncryptFiles,{FCF5B653-CC05-4183-981B-F5EF4906DD09},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:12 PM,1/29/2008 1:59:12 PM,0,0x,(null) PackageEnd,MIMKEIMC11N,MI rustserviceadmin,PTADailyTransactionExtract,{46F7381F-B345-47DC-BFC0-17CCF02A935A},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:12 PM,1/29/2008 1:59:12 PM,1,0x,End of package execution.
Can a batch file that resides on another server be executed from a different machine? I have a batch file that resides on a server that I would like to run using SQL 2005 Integration Services. Is there anything I can do that would allow me to remotely execute this batch file and have it run in that environment.
BATCH FILE:
cd C:Trandev otrun -at OTRecogn.att -DINPUT_FILE=%1 -tl 1 -cs dv -lg mylog -I C:Trandev represents the remote environment
I have tried mapping the remote machine to a network drive on my local machine and using that drive to execute the batch file in an Execute Process Task, but it does not work.
SSIS:
I have a FOR EACH loop grabbing files and writing fileName to a variable that is passed to the Process Task as an argument through an expression(%1 in the batch file above). The Working Directory is a mapped network drive. The Executable is also a network drive plus batch file name.
Any help would be appreciated.
My computer is a HP Compaq dc7100, 512mb RAM, WindowsXP
I have a remote batch file on machine B that I need to execute using 'Execute process task' control from a package on machine A. The batch file uses pgp software and encrypts a file sitting on machine B itself. The reason why my batch file is sitting on machine B, is because the PGP software is on machine B.
If I execute the batch file by itself from machine B, the script runs fine. I refer the same batch file as a UNC path from my package on machine A. But that does not work since the 'Working directory' is still machine A. I can not set machine B's folder as the working dir because it does not accept UNC path. So I say, ok , let me map a path to that UNC location and map it as drive 'Z:'. Certainly if I do so, I will be running the process on machine A and the batch file will look for the pgp software on machine A, and hence fail.
I have tried third party remote batch execution tools (PSEXEC) but have not had success, not because of SSIS limitations, but simply because the PGP executable when run through the PSEXEC tool, does not identify the location of the public keys on machine B and hence gives an encrytion failure.
How do I get the remote batch file to execute such that it executes with its own env? Is there a better remote execution tool I can try or are there any other features of SSIS I can use to get around this issue? I need the results of the batch file and hence do not want to make it an asyncronous process.
For a GPS utility project we are planning on extracting certain attributes from a huge "GPS Raw Data" read only database which we have access to containing GPS data from several years from several devices attached to vehicles.The data is time stamped. Where the time gap between pieces of data is more than 10 minutes, a new trip is instance is assumed and in our write access "Trip" database we create a new instance for the data clump with a new trip id along with the time range of the data. The process is to be run hourly to update the "Trip" database with new trips and append to overlapping trips. We've some questions:a) Is it easy to read from one database and write into another in c# hourlyb) How would one go about running a C# program automatically every hour on the server?c) Is there a better way to do this than an hourly update? (dynamically perhaps??)d) When querying the database and comparing the time stamps, how for instance would we go about identifying a 10 minute gap when the time/date is in the format "22/12/2007 11:25:00". I can't get my head around actually writing this - it's probably ridiculously simple
Setup is a common VB.NET application, SQL back, with 5-10 users. Occassionaly from another VB.NET app, I'll need to run a process to upload and insert a handful of records. The records are somewhat large with 100+ fields that require a handful of SELECT and UPDATE statements making the server 'busy' for several minutes.
Independently, the Main application and the Upload application work just fine. It's only when users are active in the main application during the time of the 'upload' process. It's almost as if they 'bump' into each other and the server throws up errors on either app even simple SQL statements. The same tables are being queried, but it doesn't feel like a concurrency issue.
Are these problems expected when running somewhat of a high load? Any ideas on how to make these guys work together without them fighting? Shouldn't SQL be able to handle the statements even during the barrage of update queries and requests? What happens in situations with hundreds or even thousands of users simultaneously accessing?
I am new to this, but have scoured the web and not found an answer to my question...
I have an execute process task that runs a simple batch file. When this batch file completes with an ERRORLEVEL greater than 0, I would like the task to fail. I thought this simply meant setting the "FailTaskIfReturnCodeIsNotSuccessValue" property to true, and setting the SuccessValue to 0. However, this does not appear to work.
Even with a simple batch file forcing the errorcode to 1 as follows, the task still completes "successfully".
I have two servers, using SQL server 2000.I was asked for implementing hourly Backup 3 databases in one serverand restore those databases to another server.Could anyone give me the detailed steps to do that?Thanks a lot in advance!
Can someone please explain database locks to me? Is there anything I need to set on the database itself when created or should locking occur without having to 'set' anything? I've had reports of 2 users being able to open the same record at the same time and each make modifications... Is this possible?? Any suggestions or thoughts?
I would appreciate any advice. Thanks! Toni Eibner
I run SQL Server 2000 and use thier database maintenance plans tobackup my databases. My questions is what happens if a change is beingmade to a database table while a backup is running? Should I be lockingthe databases before the backup begins?Scenario:1) Database Plan begins backup at 7:00 PM.2) At 7:01 PM a web user updates their password while the backup istaking place.3) at 7:15 PM the backup is complete.In this scenario, will the change/update made in step (2) be containedwithin the backup?On Another note, can anyone point me in the right direction for "BestPractices" on establishing a Recovery Mode for a database? I have beentold to set it to "Simple" so the logs do consume a lot of disc spaceand performance. The issue with this is I am not sure if I should bemaintaining a full transaction log. Our database only changes on amonthly basis. The only "on going" updates that may take place is auser changing their password. We also have other databases that changeoften throughout the day. I assume after a transaction log has beentruncated, the amount of disk space it consumes is minimal? So pleaseany information or a kick in the right direction would be muchappreciated. Thanks.
I find that after the website has been running for a while I can no longer open the database using SQL Server Management Studio Express (I get an error indicating that the physical file has been locked). Even if I shutdown and restart both IIS and SQL Server, it remains locked and can only be opened once I find and "End Process" all the sqlservr.exe instances from the Task Manager.
Is this a known issue? Any way to find out what is locking the database, or any specific configuration to check?
Apologies for the simplicity of the question, but it reflects mycapabilities! I have the following sample fields coming from differenttables:LocationTimeDate (timestamp)DataI need to return the average of Data per Location per HOUR.Thanks.
Hi I am using VWD 2008, SQL Express 2005, Reporting Services, Win-XP, IIS5Basically let's say I have 2 pages:Page1: has a SQLDataSource control that populates a GridView from a table from a database file myDB.mdf (no code behind)Page2: has a reportviewer control that show a report with data from the same table from myDB.mdf from the reportserver, (no code behind)I have attached myDB.mdf to the SQL Server Express using the SQL Server Management Studio Express.If I first open Page2 to display the ReportViewer it works ok. or using the Report ManagerNow this is the problem:If after that I try to open Page1 then a get an error message:Cannot open user default database. Login failed.Login failed for user 'myServerASPNET'. Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.Login failed for user 'myServerASPNET'.Then I have to restart the SQL Server to fix it,Now I can open Page1 ok, but if after this I try to open Page2 (ReportViewer) againThen I get this error:" An error has occurred during report processing. o Cannot create a connection to data source 'my_Datasource'. &And this error if open the report using the report manager:" An error has occurred during report processing. o Cannot create a connection to data source 'my_Datasource'. § Unable to open the physical file "C:InetpubwwwrootWebsiteApp_DatamyDB.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)". &Now if i check the Management Studio Express again, you can see that myDB.mdf was detached. It seems to be there by it has no Tables or definitions, so I have to attach it again..Do you know how to fix this?Thanks in advance,Ed
I m using sql server 2005 i have got one request ,to apply page level locking on database can nyone how it is done i can do that for a single script and for session(transaction isolation level) but dont know about database level locking scheme
I used "OLE DB Command"(row by row) for update but because i found that very very slow i decided to try batch update. I check what is for insert and what is for update and those things that are for update i save to temp table. Then i run this: update [ODS].[dbo].[Adres] SET [MutatieDatumEinde] = stAdres.MutatieDatumEinde, [StraatNaam] = stAdres.StraatNaam, [HuisNummer] = stAdres.HuisNummer, [HuisNummerToevoeging] = stAdres.HuisNummerToevoeging, [Postkode] = stAdres.Postkode, [Plaats] = stAdres.Plaats, [Land] = stAdres.Land, [IndicatiePTTAdresStandaard] = stAdres.IndicatiePTTAdresStandaard, [KodeHerkomstAdres] = stAdres.KodeHerkomstAdres, [VervalDatum] = stAdres.VervalDatum, [BronODS] = stAdres.BronODS from [ODS].[dbo].[Adres] oAdres inner join [M2O_Stage].[dbo].[ODS_Adres] stAdres on oAdres.InstNr = stAdres.InstNr and oAdres.TypeAdres = stAdres.TypeAdres and oAdres.MutatieDatumAanvang = stAdres.MutatieDatumAanvang where stAdres.IsInsert = '0'
I run this as an "execute sql task". Everything is running as it should and speed is incomparable, but.. i have problem to make this generic... what i mean is.. db names will change. How can i make db names dynamic here ?
p.s. i just got idea .. i could probably make dynamic sql statement in script component and then run it there... but does anyone have a better idea ?
I am trying to get hourly data on a table which was working fine on mysql but not on sql. how to use this in sql server managmenmt studio, i receive 'time' is not a recognized function name.and curdate() is not recognise function.
select [pa_number], [pa_surname] ,[pa_forename], sum(time(datetime) >= '07:00:00' and time(datetime) < '08:00:00') as '7.00-8.00 AM', sum(time(datetime) >= '08:00:00' and time(datetime) < '09:00:00') as '8.00-9.00 AM', sum(time(datetime) >= '09:00:00' and time(datetime) < '10:00:00') as '9.00-10.00 AM ', sum(time(datetime) >= '10:00:00' and time(datetime) < '11:00:00') as '10.00-11.00 AM',
HiHow can I create a job in sql agent to create a new snapshot every hour?I have, for eg a T-SQL that does it manually.create database Snapshotter_snap_20070418_1821 on( name = Snapshotter, filename ='c: empSnapshotter_snap_20070418_1821.ss')as snapshot of SnapshotterNow, what I do NOT want, is to only have one copy, but rather to do thisevery hour or two through out the day - and keep the old copies for sometime. (In that case, a DROP database, and a CREATE database <generic name>is easy).Any help appreciated,M
First time here so please bear with me.Set up a DTS package to export data to an excel sheet on an hourlybasis. Problem is, it keeps appending to the same excel sheet.Any idea how to prevent that. All I want to accomplish is that everyhour, the latest data is in the excel sheet and the previous data isdeleted.Thanks in advance!
I am using following sql to extract locking information in database. It only work on current selected database, how can I tune to work on all databases and not only currently selected?
SELECT DISTINCT ES.login_name AS LoginName, L.request_session_id AS BlockedBy_SPID, DATEDIFF(second,At.Transaction_begin_time, GETDATE()) AS Duration_Sec, DB_NAME(L.resource_database_id) AS DatabaseName,
I have backed up databases from a 2008 server and now I would need to restore them to a 2012 , the only issue is that I need a script bcuz I have over a hundred databases.
I am using the following query in a view to retrieve the latest 24 hourly records for a site.This returns 24 hourly records for the last day of measurements at a Site.This works great. However, I now need to retrieve the latest hourly records from the current hour. For example, hours will run from 00:00 to 23:00 and if the query is executed at 15:00, I will return only hourly records for 00:00 to 15:00 etc. I believe I need to filter the result set or modify the query to exclude records greater than the current hour.
I am using the below script and I am getting data for 15 minutes interval. I would like to aggregate this data to hourly so instead of reading for 2014-01-01 00:15:00.000 and 2014-01-01 00:30:00.000 I want all the data aggregated for 2014-01-01 00:00:00.000 and then for 2 o’clock. how should I tweak this query to sum the interval values and display it?
SELECT r.MeterId, r.ReadingDate, r.Reading FROM MeterReading r, MeterDetail d, Building b where r.MeterId = d.MeterId and d.BuildingId = b.BuildingId and b.BuildingName like '%182%' and r.ReadingDate between '2014-01-01'and '2014-01-10' order by r.MeterId