Queued Tasks
Apr 24, 2008What command can I issue from query analyzer to list tasks in the queued_tasks table. I would like to see tasks assigned to be run, completed, running, and error.
Thanks
What command can I issue from query analyzer to list tasks in the queued_tasks table. I would like to see tasks assigned to be run, completed, running, and error.
Thanks
Hi all,I've a problem with sql server 2000 EE.I've a DB with a table with lots of records. I run a SELECT fromquery analyzer, and I've results in 10 seconds. Perfect.When I run the query two times in the same table, seems likeit been queued. Result in 20 seconds.With another query, I've result in 40 seconds. If I run this query 2times, I've results in 80 seconds.How can it be? Does Sql Server queue the query?thanks, and sorry for bad english! :D
View 3 Replies View RelatedWhen multiple readers are waiting on a message from the same queue, I would expect that the reader that has been waiting the longest would be the first to pick up a message. However, I'm shocked to discover that the opposite seems to be true; in my tests I'm showing that the reader that has been waiting the least time picks up a message first! This seems totally counter-intuitive, and I'd like to know why it's working this way. This implementation will cause a lot more reader timeouts to occur than a properly queued method. For instance, assume that I have two readers, each using a one minute timeout. Reader #1 starts waiting, and reader #2 is busy for another 20 seconds before it starts waiting. 39 seconds later a message comes in and reader #2 will pick it up, leaving reader #1 to time out one second later! I would much rather have reader #1 pick up the message and reader #2 continue to wait for 20 more seconds.
I'm considering filing a bug on Connect about this, but I thought I'd post here first and see if I can get an answer...
Following is the script I'm using to test:
---Setup / Window #1---
--------------------------------------
CREATE DATABASE SimpleSSB
GO
USE SimpleSSB
GO
--Create a database master key
CREATE MASTER KEY
ENCRYPTION BY PASSWORD = 'onteuhoeu'
GO
--Create a message type
CREATE MESSAGE TYPE Simple_Msg
VALIDATION = EMPTY
GO
--Create a contract based on the message type
CREATE CONTRACT Simple_Contract
(Simple_Msg SENT BY INITIATOR)
GO
--create a queue
CREATE QUEUE Simple_Queue
GO
--Create a service
CREATE SERVICE Simple_Service
ON QUEUE Simple_Queue
(Simple_Contract)
GO
--------------------------------------
---Go start the other windows now---
---Readers: Windows #2-n ---
--------------------------------------
USE SimpleSSB
GO
WAITFOR
(
RECEIVE *
FROM Simple_Queue
), TIMEOUT 300000
--------------------------------------
---Start at least two readers, then do---
--------------------------------------
--send a message...
DECLARE @h UNIQUEIDENTIFIER
BEGIN DIALOG CONVERSATION @h
FROM SERVICE Simple_Service
TO SERVICE 'Simple_Service'
ON CONTRACT Simple_Contract
WITH ENCRYPTION=OFF;
SEND ON CONVERSATION @h
MESSAGE TYPE Simple_Msg
GO
--------------------------------------
... the last reader you've started will pick up the message first. Note I'm testing on 9.0.3033, in case that matters.
Thanks!
Dear friends
I have a simple doubt.
1)What is the difference between Queued Updating & Immediate Updating in Transactional Relplication.
2)What is the difference between Meged Replication & Peer to Peer replication.Because in both each node will Act as Publisher/Subscriber.So load balancing is possible both type replication na?
3) how to replicate views,stored procedure & functions.Beacuse when applying intial snapshot the copy is getting in subscriber.But afterwards whatever changes occurring in view,procedure not propagating from publisher to subscriber.what to do in this case
Filson
This is my syntax which looks valid to me, but the message will never send, need to get the message to send? (@recipients & @from_address are junk here, but valid email addresses in my procedure)
Code:
exec msdb.dbo.sp_send_dbmail
@profile_name = 'DatabaseMail',
@recipients = 'loggedinuser@domain.com',
@body_format = 'HTML',
@from_address = 'SQLEmailAccount@domain.com',
@body = 'Test 12345',
@subject = 'Test Email From SQL Server';
Hi All,
I have a problem replicating data from Subscriber to Publisher.
I configured Queued updatable subscriptions in transactional replication. Publisher is on SQL Server Standard edition and Subscriber is on SQL Server Express edition, both on Windows XP.
When I insert/update data in publisher, the data is replicated to subscriber. If I insert/update data on subscriber the data is not replicated. When I see the replication monitor for errors, it shows an error "Cannot load a DLL xprepl.dll or one of its resources".
Could any one give me a solution or please tell me if I missing something?
Thanks you all,
Ravi.
I want to send an email twice a day, from database. So I have planned to make a storedproce which will be called by a job (which will select some record from one table and put it in other table based on a flag) but I want to run it in a transaction so that if email is send successfully then only it should commit else it should rollback.
How can i find that "Mail queued" now i should commit.
I have an After Update Trigger specified on a database table to notify specific users via email when certain customer values are modified. (This is a HACK / Workaround for functionality that doesn't exsist in the product.)
I had be using xp_sendmail without a problem. I recently upgraded the database server to SQL2005 and wanted to try sp_send_dbmail. (I was interested in the asynch and the non-MAPI nature of Database Mail.)
This is the new code:
EXEC @retval = msdb.dbo.sp_send_dbmail
@recipients = @rec,
@blind_copy_recipients = @bcc,
@subject = 'Important Customer Information Change',
@body = @body
This is the old code:
EXEC @retval = master.dbo.xp_sendmail
@recipients = @rec,
@blind_copy_recipients = @bcc,
@subject = 'Important Customer Information Change',
@message = @body
The problem now is that the application reports an update failure because the sp_send_dbmail return the message "Mail Queued."
I don't know if there's a way to suppress this message or not. Or some other way to indicate that "all is well" even though the stored procedure returned a message.
Thanks in advance.
We have a ASP.Net 2.0 web application and need to send out emails. We have an EmailQueue table in our database where email gets stored before it is send out. We are looking at the pros and cons of using Database Mail in SQL Server 2005 to send out our emails. Should we use SQL or our web app to send email???Tips, tricks, articles, experiences, opinions are greatly appreciated. Newbie
View 2 Replies View RelatedI want to send an email two ice a day, from database. So I have planned to make a storedproce which will be called by a job (which will select some record from one table and put it in other table based on a flag) but I want to run it in a transaction so that if email is send successfully then only it should commit else it should rollback.
How can i find that "Mail queued" now i should commit.
Hi
I'm running transactional repl with updateable subscribtions - queued updating. Running SQL 2005 sp2, win 2003 sp1
I have 18 odd subscribers at the moment, my publisher and disttribution is on the same machine with push subscriptions.
The questions I have
nr 1.
While trying to initialize new subscribers I get loads of deadlocks even after I stop dist cleanup agent. This *I think* cause some other unexpected problems.
nr2.
The queue reader would fail saing it cannot find the "insert" proc on the publisher, although it exists.
I have changed anything on the publication so I'm not sure how this happens or why.
nr3.
I replicate a varbinary(max) column and on the odd occasion get the "Length of LOB data" errors which I then set with sp_configure. The catch here is that the length never exceeds a "len()" of 4000, thus the reported LOB and my calculation doesn't tie up.
Help is appreciated.
Thanks
are there restrictions on what a DBA can do on a developer's edition?
i'm asking coz i get really bad connection problems when changing service accounts, client aliases, port numbers, connecting to different components like ssis, reporting services, database engine, etc...
in sql2000, changing these things are a breeze, is there some guidelines when making these changes in 2005?
TIA
--------------------
keeping it simple...
Hi guys
Just want to know whether you guys do the following as a dba:
1. Setup a logging for tracking database as well as table size that containing size, indexing size. You can measure the growth.
2. Record for indexing for each database. I think this is over kill task.
3. Record database setup such as create statistic, update statistic etc.
These tasks can be automate to record every month for example and record this into Administration database for instance.
What else you guys record?
Thanks
If I'm in the Data Flow tab in VS 2005, how can I select only certain components to run to test? I tried highlighting the ones that I want to run but it's running all of them in the tab...some of the components I want to take out for testing then maybe put back in later. If I delete the tasks I don't want to run, then I end up having to recreate them
View 11 Replies View RelatedWhere to look for the web assitant created jobs on the server?I created a web page using the web assistant which is suppossed to get updated each time a value changes in a particular table,but I can't find the task which I created ,where do i look for that?I didn't use this wizard previously.thanks for any help!
Sheila.
Would anyone be aware of anyplace I could find some good information on creating DTS custom tasks? I've come across a couple of articles from SQL Server Magazine, but nothing too substantive...
Better yet, if anyone has any success (great or small), I'd like to hear from you and hear some of the things you did, what your custom task does, difficulty.
I'm just trying to get an idea of how much work I have ahead of me....
Thank You...
If I have 2 scheduled tasks set for the same time (perhaps accidentally), will the
SQL Executive start 1 and queue the other one until the first is complete and
then run the 2nd task? Or will they both be started simultaneously?
Thanks!
Toni Eibner
I have been running the following production job successfully for a long time.
It now fails, and the Task History Last Error Message displays 'No Message'.
The log file ( C:MSSQLLOGMaint_TombV50.txt) shows it ran successfully,
with a Return Code 0.
SQLMAINT.EXE -D TombV50 -RebldIdx 10
-CkDB -CkAl -CkTxtAl -CkCat
-UpdSts -Rpt C:MSSQLLOGMaint_TombV50.txt
It looks like SQL Executive burps for some reason.
Any ideas, comments, suggestions?
Thanks,
sb
To all,
If I have a scheduled tasks that is owned by 'sa', how can I assign permissions to allow another user, even the database dbo, to register the SQL server and view the scheduled tasks?
Thanks in Advance,
Ed Molinari
Hello ,
I need create tasks, which will be wake up daily to backup 4 databases.
My questions are:
1. Can I create 1 task to backup all databases using TSQL command?
Ex: DUMP DATABASE test1 to test1_backup
DUMP TRANSACTIONS test1 to test1_backup with truncate_only
DUMP DATABASE test2 to test2_backup
DUMP TRANSACTIONS test2 to test2_backup with truncate_only
Etc.
If it’s possible can I just print this command to ‘Command:’ text box in the ‘New task’ window
without writing the TSQL command into a text file and execute it with the ISQL program through
CmdExec??????
2.If first doesn’t work: can I do the same job, but create for every backup own task and run the same
TSQL command for particular database. And if I can is it possible to schedule run all 4 tasks the same time or I should put time’s interval?
3. If 1. And 2. Are false. Give me your smart advice.
Thank you,
Sev
Is anybody knows how to transfer all the tasks in one server to another?
Our development database will be transferred/copied to a new production box
and that includes all tasks that we've created. We have almost a hundred
tasks defined and we don't want it create manually. If someone had done
this before, please give me a hint, i appreciate it very much!
Thanks.
vic
Hi all,
I've got a DTS job which has lots of tasks in it. I've also got quite a few flows of workflow and i've noticed that a task won't execute if it has both Failure and Success workflow pointing to it... It can have multiple failures pointing to it and it will execute but it can't have multiple successes or a combination of workflows...
Does anyone know a way to get around this or to change the 'AND' ing that seems to be on the workflow going into a task..
Thanks.
Hi,
I just volunteered to be the database administrator of our new sql server. I am normally the programmer so I have little experience with database administration. There are some basics that I need some assistance with mainly when to perform various maintanence checks. For example, how often do I need to perform some of the dbcc commands that I have read about? How often do I check for data integrity, index fragmentation, rebuilding indexes, or defrag indexes?
I have to come up with a plan by tomorrow and I don't know if I have anything solid enough since I don't exactly know when to perform some of these tasks. :confused:
Thanks so much for your advice.
Can someone let me know any 10 things that are usally automated using the SQL Server Agent,
I mean besides backup what all can i automate
Thanks
could some one help in giveing solution for this tasks..
[CODE]
Task 1 : Get the first day and last day of the week
Ex: input : '04/12/2006'
Required ouput :
start_date End_date
04/09/200604/15/2006
Note :1. start_date should be sunday
2. end_date should be saturday
Task 2 -- Find the product sales week wise
Find the product sales week wise
Output Required:
gasstationID productClass week1 week2 week3 week4
-------------------- ------------ ----------- ----------- ----------- -----------
111 DSL 1 0 0 0
111 GAS 2 0 1 1
222 DSL 1 0 1 1
222 GAS 1 0 0 0
create table trial_sales(
gasstationIDbigint,
salesDatesmalldatetime,
gallonsbigint,
productClass varchar(4))
insert into trial_sales values(111,'11/01/2005',10000,'GAS')
insert into trial_sales values(111,'11/02/2005',1000,'GAS')
insert into trial_sales values(111,'11/02/2005',20000,'DSL')
insert into trial_sales values(222,'11/01/2005',10000,'GAS')
insert into trial_sales values(222,'11/02/2005',10000,'DSL')
insert into trial_sales values(111,'11/15/2005',1000,'GAS')
insert into trial_sales values(222,'11/15/2005',10000,'DSL')
insert into trial_sales values(111,'11/25/2005',1000,'GAS')
insert into trial_sales values(222,'11/25/2005',10000,'DSL')
Task 3 Display unique values
Display unique values in
create table t (colA varchar(25))
insert into t values('apple')
insert into t values('bat')
insert into t values('car')
ouput required:
a
b
c
e
l
p
r
t
Task : 4
I have a table in the database I am working with with the following columns:
(I have simplified this down for the sake of clarity)
int p1
int p2
int p3
int s1
date d1
string s1
There is no primary key and the table more resembles a log than anything.
e.g.
p1 p2 p3 s1 d1 s1
1 12 14 100 23May comment 2
1 12 14 800 22May comment 1
1 12 14 300 24May comment 3
1 12 15 100 22May comment 2
1 12 15 800 21May comment 1
2 12 15 100 23May comment 1
What I want to do is exttract the rows from the table where the combination
of p1 p2 and p3 is distinct/unique and the date is the most recent one for
all combinations of p1, p2, p3. So from the table above I would end up with
the resultset:
p1 p2 p3 s1 d1 s1
1 12 14 300 24May comment 3
1 12 15 100 22May comment 2
2 12 15 100 23May comment 1
Task 5
say i have the following data...
uId(int PK), productcode(int), quantity(int)
1,12,5
2,12,3
3,12,5
4,11,9
....and i have an order for productcode 12 with quantity of 6 products.
i need to select only enough rows to reach a quantity of 6.
in this case, i would want the first two rows which would give me a sum of
8.
how can i do this without looping through each record, getting the quantity
and exiting the loop when i have a sum >= 6?
Task 6
I have two tables as below, TABLE1 and TABLE2.
TABLE 1: Base
IDPNamePPrice
-------------------------------------
1A30
2B20
TABLE 2: History
IDLdateAmount
-------------------------------------
12005/8/750
The ID of TALBE1 is the primary key and the ID of TABLE2 is the foreign key.
What's the right T-SQL JOIN statement when I pass the date of 2005/8/7,
it will return the result as below:
LdatePNameAmount
------------------------------------
2005/8/7A50
2005/8/7Bnull
and when I pass the date of 2005/8/8, it will return the result as below:
LdatePNameAmount
------------------------------------
2005/8/8Anull
2005/8/8Bnull
Task : 7
Reverse the Name
create table sample_judge(
judge_namevarchar(50))
go
insert into sample_judge values ('J Smith')
insert into sample_judge values ('M Samuel')
insert into sample_judge values ('S Shan')
insert into sample_judge values ('K Anand')
insert into sample_judge values ('K K K K Anand')
insert into sample_judge values ('K R Shanth Anand')
insert into sample_judge values ('K R Shanth Anand Kumara Velu')
go
Expected Output :
Smith J
Samuel M
Shan S
Anand K
Anand K K K K
Shanth Anand K R
Shanth Anand Kumara Velu K R
[CODE]
thanks in adv
chakri
Hi,
I would like to run several checklists against each sql server 2005 instance.
I can get a list of the sql server 2005 machines (Which are on the network) from a sql server table.
There is a another table which holds the list of the checks that need to be carried out against each sql server 2005 machine called tblCheckList.
The list of tasks in the table is briefly as follows:
1) get the path where the .mdf file is placed.
2) get the path where the .ldf file is placed
3) get the path where .BAK or .TRN are placed
4) get the path where the sql 2005 is installed
5) get the servicepack version
6) get the authentication
7) remove sample databases i.e. northwind or pubs, etc...
8) get the recovery model on UserDB
9) get the size of each database
...
...
...
The list goes on
Thanks
Can someone let me know any 10 things that are usally automated using the SQL Server Agent,
I mean besides backup what all can i automate
Thanks
Just wonder what do you dba do in your daily tasks. I usually have meetings where I have to say what Ive been doing during the week.
=============================
http://www.sqlserverstudy.com
Is it possible to schedule tasks in SQL Express, for example a database backup, or to periodically execute a stored procedure?
View 3 Replies View Related
Hi,
I am using Windows 2000 and created around 15 scheduled tasks. My scheduled tasks supposed to run every morning. I have to set password to first scheduled tasks every morning; otherwise none of the scheduled tasks works. As soon as i put password in the scheduled tasks, other tasks work fine.
Any ideas how to save password to schedule task?
Thanks in advance..
Hi all,
I will be entering a job as a Junior Sql Server DBA with no senior above me. I would like to know what a DBA does everyday and all day.
If anyone can give me a thorough answer I would very much apreciate it, what are the day to day tasks.
Receiving projects is one thing, that is understood, but sometimes there are no projects and u r just supposed to do ur job.
What do you do as soon as you start your shift, then half an hour later at 9am what do you do then?
then at 10am what do you do, then 11am, noon, 1pm, 2pm, 3pm, 4pm, etc.....
Do do you do all day and everyday? Someone please give me a thourough answer.
Thank You very much
Folks,
I am sort of new to SSIS.. I am doing the following
- Have a package that does some data transformation
- The transformed data is written to a csv file
- The csv file is copied to multiple destinations by a script task
All the above actions are performed in one package.
The SSiS log is not very helpful it just mentions a generic error code that is of no use.
Q1) If I need to separate the above actions in the Sql Server job scheduler as separate tasks do I have to
split the above tasks into separate dtsx files ?
If so how can we have the first dtsx kickoff the second one and can the second dtsx file share the variables ?
Q2) does anyone have any suggestions or examples on how log each step of your dts package to a log file
Thanks
Hi All,
How to Schedule the execution of set of packages for every one hour. In the control panel > Schedule tasks >
There are options available only to the day granular level.
Any ideas on this would be appreciated.
Thanks in advance ...