Hi!
How to change the number of re-trys in transactional replication
before it times out? Currently (by default) it is set to 10. I would
like to increase it to 30 or 40.
Please advise.
thank you,
T.
The retry count is on the advanced tab of the run agent step of the
distribution agent's job.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
|||On Feb 21, 10:15 am, "tolcis" <nytolly...@.gmail.com> wrote:
> Hi!
> How to change the number of re-trys in transactional replication
> before it times out? Currently (by default) it is set to 10. I would
> like to increase it to 30 or 40.
> Please advise.
> thank you,
> T.
One thing I often do is to add a schedule to the replication jobs in
SQL Agent, scheduling them to run every 5 minutes. If one of the
replication agents does time-out and fail, it will restart itself
within 5 minutes.
Showing posts with label default. Show all posts
Showing posts with label default. Show all posts
Monday, March 26, 2012
re-try on replication
Hi!
How to change the number of re-trys in transactional replication
before it times out? Currently (by default) it is set to 10. I would
like to increase it to 30 or 40.
Please advise.
thank you,
T.The retry count is on the advanced tab of the run agent step of the
distribution agent's job.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||On Feb 21, 10:15 am, "tolcis" <nytolly...@.gmail.com> wrote:
> Hi!
> How to change the number of re-trys in transactional replication
> before it times out? Currently (by default) it is set to 10. I would
> like to increase it to 30 or 40.
> Please advise.
> thank you,
> T.
One thing I often do is to add a schedule to the replication jobs in
SQL Agent, scheduling them to run every 5 minutes. If one of the
replication agents does time-out and fail, it will restart itself
within 5 minutes.sql
How to change the number of re-trys in transactional replication
before it times out? Currently (by default) it is set to 10. I would
like to increase it to 30 or 40.
Please advise.
thank you,
T.The retry count is on the advanced tab of the run agent step of the
distribution agent's job.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||On Feb 21, 10:15 am, "tolcis" <nytolly...@.gmail.com> wrote:
> Hi!
> How to change the number of re-trys in transactional replication
> before it times out? Currently (by default) it is set to 10. I would
> like to increase it to 30 or 40.
> Please advise.
> thank you,
> T.
One thing I often do is to add a schedule to the replication jobs in
SQL Agent, scheduling them to run every 5 minutes. If one of the
replication agents does time-out and fail, it will restart itself
within 5 minutes.sql
re-try on replication
Hi!
How to change the number of re-trys in transactional replication
before it times out? Currently (by default) it is set to 10. I would
like to increase it to 30 or 40.
Please advise.
thank you,
T.The retry count is on the advanced tab of the run agent step of the
distribution agent's job.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||On Feb 21, 10:15 am, "tolcis" <nytolly...@.gmail.com> wrote:
> Hi!
> How to change the number of re-trys in transactional replication
> before it times out? Currently (by default) it is set to 10. I would
> like to increase it to 30 or 40.
> Please advise.
> thank you,
> T.
One thing I often do is to add a schedule to the replication jobs in
SQL Agent, scheduling them to run every 5 minutes. If one of the
replication agents does time-out and fail, it will restart itself
within 5 minutes.
How to change the number of re-trys in transactional replication
before it times out? Currently (by default) it is set to 10. I would
like to increase it to 30 or 40.
Please advise.
thank you,
T.The retry count is on the advanced tab of the run agent step of the
distribution agent's job.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||On Feb 21, 10:15 am, "tolcis" <nytolly...@.gmail.com> wrote:
> Hi!
> How to change the number of re-trys in transactional replication
> before it times out? Currently (by default) it is set to 10. I would
> like to increase it to 30 or 40.
> Please advise.
> thank you,
> T.
One thing I often do is to add a schedule to the replication jobs in
SQL Agent, scheduling them to run every 5 minutes. If one of the
replication agents does time-out and fail, it will restart itself
within 5 minutes.
Labels:
database,
default,
microsoft,
mysql,
number,
oracle,
re-try,
re-trys,
replication,
server,
sql,
transactional
Wednesday, March 21, 2012
Retrieving rows with 2 indexes
I have a table that contains 2 keys (iId and iVersion) and some other data:
iId int(4) NOT NULL default '0',
iVersion int(4) NOT NULL default '0',
vchName varchar(50) default NULL
The data looks a little like this:
1|1|Fred
1|2|Fred edited once
1|3|Fred edited twice
2|1|Dave
2|2|Dave edited once
2|3|Dave edited twice
I need a sql statement that will return all columns of the latest row (based on the greatest iVersion value) for each unique iId in the table.
So using the data above it should return
1|3|Fred edited twice
2|3|Dave edited twice
Any help would be appreciated!select iId,
iVersion,
vchName
from <table_name>
group by iId
having iVersion = max(iVersion)|||Try:
select iId,
iVersion,
vchName
from <table_name>
where (iId, iVersion) in
( select iId,
max(iVersion) maxVer
from <table_name>
group by iId
);
Or if using Oracle you could use the analytic functions.|||I would suggest using:SELECT *
FROM myTable AS a
WHERE a.iVersion = (SELECT Max(b.iVersion)
FROM myTable AS b
WHERE b.iId = a.iId)-PatP|||May have been that i was using MySQL but none of the above worked!
They did however help me to get some sql that does work...
select iId, vchName, MAX(iVersion) as iVersion
from <Table>
GROUP BY iId
Thanks.|||select iId, vchName, MAX(iVersion) as iVersion
from <Table>
GROUP BY iIdyou may think this works, but it doesn't
even the mysql docs tell you that this gives unpredictable results (holler if you need the link to the page in the docs where it explains this)
what you want is the vchName that comes from the row which has the largest iVersion, but this is not what you are getting, and if it looks like you are getting it, it is a fluke
you could just as easily get this instead --
1|3|Fred edited once
2|3|Dave
i'm sorry if this sounds like i'm dumping all over you, it's not your fault, it's mysql's fault for allowing non-standard sql to run (in any other database system, your query would generate a syntax error)
here's what you want, done without subqueries if you're not on 4.1 yet --
select X.iId
, X.iVersion
, X.vchName
from yourtable as X
inner
join yourtable as Y
on X.iId
= Y.iId
group
by X.iId
, X.iVersion
, X.vchName
having X.iVersion
= max(Y.iVersion)
iId int(4) NOT NULL default '0',
iVersion int(4) NOT NULL default '0',
vchName varchar(50) default NULL
The data looks a little like this:
1|1|Fred
1|2|Fred edited once
1|3|Fred edited twice
2|1|Dave
2|2|Dave edited once
2|3|Dave edited twice
I need a sql statement that will return all columns of the latest row (based on the greatest iVersion value) for each unique iId in the table.
So using the data above it should return
1|3|Fred edited twice
2|3|Dave edited twice
Any help would be appreciated!select iId,
iVersion,
vchName
from <table_name>
group by iId
having iVersion = max(iVersion)|||Try:
select iId,
iVersion,
vchName
from <table_name>
where (iId, iVersion) in
( select iId,
max(iVersion) maxVer
from <table_name>
group by iId
);
Or if using Oracle you could use the analytic functions.|||I would suggest using:SELECT *
FROM myTable AS a
WHERE a.iVersion = (SELECT Max(b.iVersion)
FROM myTable AS b
WHERE b.iId = a.iId)-PatP|||May have been that i was using MySQL but none of the above worked!
They did however help me to get some sql that does work...
select iId, vchName, MAX(iVersion) as iVersion
from <Table>
GROUP BY iId
Thanks.|||select iId, vchName, MAX(iVersion) as iVersion
from <Table>
GROUP BY iIdyou may think this works, but it doesn't
even the mysql docs tell you that this gives unpredictable results (holler if you need the link to the page in the docs where it explains this)
what you want is the vchName that comes from the row which has the largest iVersion, but this is not what you are getting, and if it looks like you are getting it, it is a fluke
you could just as easily get this instead --
1|3|Fred edited once
2|3|Dave
i'm sorry if this sounds like i'm dumping all over you, it's not your fault, it's mysql's fault for allowing non-standard sql to run (in any other database system, your query would generate a syntax error)
here's what you want, done without subqueries if you're not on 4.1 yet --
select X.iId
, X.iVersion
, X.vchName
from yourtable as X
inner
join yourtable as Y
on X.iId
= Y.iId
group
by X.iId
, X.iVersion
, X.vchName
having X.iVersion
= max(Y.iVersion)
Monday, March 12, 2012
Retrieving Default Values for Parameters in a Stored Procedure.
I'm generating a list of parameters needed by stored procedures, andI'd like to know which ones have default values assigned to them.
To retrieve the parameter information I use:
sp_sproc_columns @.Procedure_Name='InsertUser''
However, the column that is supposed to give the default value,'COLUMN_DEF' always returns as NULL, even when that column has adefault value assigned to it.
i.e.
CREATE PROCEDURE InsertUser
@.UserID INT = 10,
....
And then if I do a sp_sproc_columns @.Procedure_Name='InsertUser'', the COLUMN_DEF value for the @.UserID column is still NULL.
Does anyone know what I'm doing wrong and how I can retrieve the default value?
Thanks
To retrieve the parameter information I use:
sp_sproc_columns @.Procedure_Name='InsertUser''
However, the column that is supposed to give the default value,'COLUMN_DEF' always returns as NULL, even when that column has adefault value assigned to it.
i.e.
CREATE PROCEDURE InsertUser
@.UserID INT = 10,
....
And then if I do a sp_sproc_columns @.Procedure_Name='InsertUser'', the COLUMN_DEF value for the @.UserID column is still NULL.
Does anyone know what I'm doing wrong and how I can retrieve the default value?
Thanks
It looks like you will have to parse the stored procedure code to get the default parameter info:
http://www.aspfaq.com/show.asp?id=2463
Hope this helps.
Chris R. Timmons
--------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Labels:
andi,
assigned,
database,
default,
generating,
microsoft,
mysql,
oracle,
parameters,
procedure,
procedures,
retrieve,
retrieving,
server,
sql,
stored,
values
Wednesday, March 7, 2012
Retrieve the default data folder path
Is it possible to find out the default path SQL Server creates databases in
depending on what instance you are connected to. E.g. My default instance
default data path is C:\Program Files\Microsoft SQL Server\MSSQL\Data. My
named instance path I also have is C:\Program Files\Microsoft SQL
Server\MSSQL$Testing\Data and my SQL Express data path is C:\Program
Files\Microsoft SQL Server\MSSQL.3\MSSQL\Data.
Can I find out the default data path for the current instance I am connected
to using a query?
ThanksYou can probably use the Model database's SysDatabases.FileName to get the
path.
"Chris" wrote:
> Is it possible to find out the default path SQL Server creates databases i
n
> depending on what instance you are connected to. E.g. My default instance
> default data path is C:\Program Files\Microsoft SQL Server\MSSQL\Data. My
> named instance path I also have is C:\Program Files\Microsoft SQL
> Server\MSSQL$Testing\Data and my SQL Express data path is C:\Program
> Files\Microsoft SQL Server\MSSQL.3\MSSQL\Data.
> Can I find out the default data path for the current instance I am connect
ed
> to using a query?
> Thanks
>
>|||Thanks Mike,
If I do the following it seems to return the path.
SELECT REPLACE(filename, 'model.mdf', '') AS DataPath FROM SysDatabases
WHERE name = 'model'
Chris
"Mike K" <MikeK@.discussions.microsoft.com> wrote in message
news:E3722206-05B2-4026-9E59-9F863C75B73E@.microsoft.com...
> You can probably use the Model database's SysDatabases.FileName to get the
> path.
> "Chris" wrote:
>|||You might want to research what database you are currently connected to.
Just checking a different database might not get you really what you want.
set nocount on
create table #output
(
spid int,
status varchar(100),
login varchar(100),
hostname varchar(100),
blkby varchar(10),
dbname varchar(30),
command varchar(50),
cputime int,
diskio int,
lastbatch varchar(20),
programname varchar(200),
spid2 int
)
insert into #output exec sp_who2
set nocount off
select
ltrim(rtrim(dbname))
from
#output
where
spid = @.@.spid
drop table #output
depending on what instance you are connected to. E.g. My default instance
default data path is C:\Program Files\Microsoft SQL Server\MSSQL\Data. My
named instance path I also have is C:\Program Files\Microsoft SQL
Server\MSSQL$Testing\Data and my SQL Express data path is C:\Program
Files\Microsoft SQL Server\MSSQL.3\MSSQL\Data.
Can I find out the default data path for the current instance I am connected
to using a query?
ThanksYou can probably use the Model database's SysDatabases.FileName to get the
path.
"Chris" wrote:
> Is it possible to find out the default path SQL Server creates databases i
n
> depending on what instance you are connected to. E.g. My default instance
> default data path is C:\Program Files\Microsoft SQL Server\MSSQL\Data. My
> named instance path I also have is C:\Program Files\Microsoft SQL
> Server\MSSQL$Testing\Data and my SQL Express data path is C:\Program
> Files\Microsoft SQL Server\MSSQL.3\MSSQL\Data.
> Can I find out the default data path for the current instance I am connect
ed
> to using a query?
> Thanks
>
>|||Thanks Mike,
If I do the following it seems to return the path.
SELECT REPLACE(filename, 'model.mdf', '') AS DataPath FROM SysDatabases
WHERE name = 'model'
Chris
"Mike K" <MikeK@.discussions.microsoft.com> wrote in message
news:E3722206-05B2-4026-9E59-9F863C75B73E@.microsoft.com...
> You can probably use the Model database's SysDatabases.FileName to get the
> path.
> "Chris" wrote:
>|||You might want to research what database you are currently connected to.
Just checking a different database might not get you really what you want.
set nocount on
create table #output
(
spid int,
status varchar(100),
login varchar(100),
hostname varchar(100),
blkby varchar(10),
dbname varchar(30),
command varchar(50),
cputime int,
diskio int,
lastbatch varchar(20),
programname varchar(200),
spid2 int
)
insert into #output exec sp_who2
set nocount off
select
ltrim(rtrim(dbname))
from
#output
where
spid = @.@.spid
drop table #output
Subscribe to:
Posts (Atom)