Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Friday, March 23, 2012

forcing an identity to be even\odd

Hi
I am not able to implement even odd series, the tables
are generating autonumbers with 'last value + 2' for the
next value (inspite of saying identity seed is 2 and
increment is 2). thisway, if the last value on
a 'supposed' even table is turming odd if the last merged
value is odd. is their a way to force newly generated
autonumbers to be only odd in odd table and only even in
even table. something like a formula?
Thanks
Svur
SVur,
this is how I set it up. On the publisher I set the seed at 1 and increment
at 2 to give odd numbers. I replicated this table to the subscriber. After
initialization I dropped the subscription. On the 'subscriber' I changed the
seed and increment to 2 and 2. I recreated the subscriber using the nosync
option and it all worked OK. You could also probably do this more directly
using @.creation_script on sp_addmergearticle.
HTH,
Paul Ibison
|||Hi Paul,
I tried to implement the way you described, but for some
reason, the identity of the new value is always the
current value + 2, irrespective of what the seed is.
I have no clue as to what goes into @.creation_script, i
have not been able to find any articles online aswell.
i would appreciate if you could help me out with this
Thanks
SVur
>--Original Message--
>SVur,
>this is how I set it up. On the publisher I set the seed
at 1 and increment
>at 2 to give odd numbers. I replicated this table to the
subscriber. After
>initialization I dropped the subscription. On
the 'subscriber' I changed the
>seed and increment to 2 and 2. I recreated the
subscriber using the nosync
>option and it all worked OK. You could also probably do
this more directly
>using @.creation_script on sp_addmergearticle.
>HTH,
>Paul Ibison
>
>.
>
|||SVur,
please script out your initial table and I'll have a go at creating a script
for you.
Regards,
Paul Ibison
|||Hi paul,
Please find the script below:
/****** Object: Table [dbo].[Tasks] Script Date:
7/1/2004 11:34:42 AM ******/
CREATE TABLE [dbo].[Tasks] (
[TaskID] [int] IDENTITY (1, 2) NOT FOR
REPLICATION NOT NULL ,
[UnitOfMeasure] [varchar] (70) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[TaskDesc] [varchar] (100) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[GUID] uniqueidentifier ROWGUIDCOL NOT NULL
) ON [PRIMARY]
GO
Thanks,
SVur
>--Original Message--
>SVur,
>please script out your initial table and I'll have a go
at creating a script
>for you.
>Regards,
>Paul Ibison
>
>.
>
|||Thanks SVur. At the moment we have two threads going essentially the same
issue (hadn't associated your name) so please let's leave this thread and
continue the previous one where I have posted my answer.
Regards,
Paul Ibison

Monday, March 19, 2012

Force Index Use

Hi

I have a reporting procedure that fetches a great deal of data
and is currently taking too long to retrieve the results (40 sec).
Looking at the execution plan, I see SQL is not using some of the indexes I added especially for the queries benefit (ie.time column), usually it uses the clustered composite PK.
Does anyone know how I can force SQL to use a particular index on
a query?

advice appreciated...

Thanks
Desmondno worries.., got it...(BOL)
Desmond|||after table name or table alias in SELECT clause and/or in JOIN clause put (INDEX=index_name)|||thanks...still needed the syntax!
des|||Originally posted by DesmondX
thanks...still needed the syntax!
des

Check this:

drop table test13
go
create table test13(id int identity primary key, code varchar(10))
go
create index i_test13 on test13 (code)
go
select * from test13 with(index(i_test13))
select * from test13 (index=i_test13)

Monday, March 12, 2012

for xml raw problem

Hi
I'm running a simple query with for xml raw on a table
one of columns in select clause here is of type text and stores xml
file itself.
The problem i'm facing is when I get this text back from this column I
get back unformatted xml
e.g
instead of getting <GPF> I get <GPF> etc
How do I get this column as formatted xml text ?
Thanks for help
Vishy>
> I'm running a simple query with for xml raw on a table
> one of columns in select clause here is of type text and stores xml
> file itself.
> The problem i'm facing is when I get this text back from this column I
> get back unformatted xml
> e.g
> instead of getting <GPF> I get <GPF> etc
> How do I get this column as formatted xml text ?
>
Hello
signs '<' and '>' are very important in XML because they show begin and end
of xml element, so when an element or attribute value has such signs it must
be changed into < and >. But when you open XML which contains such
substitution - using DOM or OPENXML in SQL you will get values with signs
'<', '>'. So I think that it sould not be a problem - siply try to process
XML which was generated and you will see that it has valid values of
elements/attributes.
I hope it helps,
Alwik|||Thanks Alwik for reply
I tried to create object on XmlDocument using LoadXml() method
it loads up the xml successfully but if I want to run any Xpath; it
fails
as <GPF> is not treated as <GPF> so I can't find GPF element
is there any work around?
Vishy|||Are you using SQL Server 2000 or 2005?
In the case of SQL Server 2000, you will have to use the explicit mode and
its !xml directive, if you want to have string data be inlined into the XML
structure.
In the case of SQL Server 2005, you can stick with the FOR XML RAW query,
but you need to cast the string data to XML in the select clause.
Best regards
Michael
"Vishy" <vishal.halbe@.gmail.com> wrote in message
news:1128445808.595093.141180@.g49g2000cwa.googlegroups.com...
> Thanks Alwik for reply
> I tried to create object on XmlDocument using LoadXml() method
> it loads up the xml successfully but if I want to run any Xpath; it
> fails
> as <GPF> is not treated as <GPF> so I can't find GPF element
> is there any work around?
> Vishy
>|||Thanks Michael for reply
I'm using SQL 2000
Vishy

Friday, March 9, 2012

for xml explicit data problem

Hi
I am running the following stored proc by executing a data set in c#.
surprisigly I am getting data padded with extra characters.
something like this - \"christy john"\. How to get rid of '\' this
character.
i try search and replace with regexp as well as string replace
functions without luck.
Here is the actual xml look like when I read from data set in c#.
<TREENODES><treenode text=\"A/L ALLANDOO, FELIX\"/><treenode
text=\"BEDI, RAHUL\"/><treenode text=\"CHALMERS, WILLIAM\"><treenode
text=\"CNOSSEN, RICK\"><treenode text=\"ANKALA, PRAVEEN\"/><treenode
text=\"BOGIA, DOUGLAS\"/><treenode text=\"COOK, HAROLD\"/><treenode
text=\"DAILY, STEPHEN\"/><treenode text=\"GAN, XIAOCHUN\"/><treenode
text=\"GARCEAU, PAUL\"/><treenode text=\"GOTTHARDT,
STEVEN\"/><treenode text=\"GUPTA, MEENAKSHI\"/></TREENODES>
Query analyser data in SQL SERVER looks perfectly alright without
special
character padding like shown beow.
<TREENODES><treenode text="A/L ALLANDOO, FELIX"/><treenode text="BEDI,
RAHUL"/><treenode text="CHALMERS, WILLIAM"><treenode text="CNOSSEN,
RICK"><treenode text="ANKALA, PRAVEEN"/><treenode text="BOGIA,
DOUGLAS"/><treenode text="COOK, HAROLD"/><treenode tex
Please help me.
Rao
-- Here is c# code --
ds = SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings[ASPNET.StarterKit.TimeTracker.Web.Global. CfgKeyConnString],
SPname);
System.IO.StringWriter strWriter = new StringWriter();
ds.WriteXml(strWriter);
strXML = strWriter.ToString();
--Here is stored procedure and c# code--
dbo.ResourceXMLTest
as
set nocount on
--Take out the next block and make this SP accept
--a variable table like it does for @.EmpToMan
SET CONCAT_NULL_YIELDS_NULL OFF
Declare @.EmpToMan table(
ResourceID int,
ManagerID int,
Depth int,
Lineage nvarchar(256),
ResourceWWID numeric(19),
RFirstName nvarchar(50),
RLastName nvarchar(50)
)
INSERT INTO @.EmpToMan
SELECT
E.EmployeeID,
E.ManagerID,
E.Depth,
E.Lineage,
R.WWID,
R.FirstName ,
R.LastName + ', ' + R.FirstName
--R.LastName + ', ' + R.FirstName
FROM
Resources R left outer join EmployeeToManager E
ON r.resourceID = E.EmployeeID
select
1 as Tag,
0 as Parent,
null as [TREENODES!1!text],
null as [treenode!2!text],
null as [treenode!3!text],
null as [treenode!4!text],
null as [treenode!5!text],
null as [treenode!6!text],
null as [treenode!7!text],
null as [treenode!8!text],
null as [treenode!9!text],
null as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
union all
select
2 as Tag,
1 as Parent,
null,
RLastName as [treenode!2!text],
null as [treenode!3!text],
null as [treenode!4!text],
null as [treenode!5!text],
null as [treenode!6!text],
null as [treenode!7!text],
null as [treenode!8!text],
null as [treenode!9!text],
null as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
from
@.EmpToMan
where
Depth + 1 = 1
union
all
select
3 as Tag,
2 as Parent,
null,
t1.RLastName,
t2.RLastName as [treenode!3!text],
null as [treenode!4!text],
null as [treenode!5!text],
null as [treenode!6!text],
null as [treenode!7!text],
null as [treenode!8!text],
null as [treenode!9!text],
null as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
from
@.EmpToMan as t1
inner join
@.EmpToMan as t2
on
t1.ResourceID = t2.ManagerID
where
t1.depth + 1 = 1
and
t2.depth + 1 = 2
union
all
--Begin Block #4
select
4 as Tag,
3 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
null as [treenode!5!text],
null as [treenode!6!text],
null as [treenode!7!text],
null as [treenode!8!text],
null as [treenode!9!text],
null as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
From
@.EmpToMan as t1
inner join
@.EmpToMan as t2
on
t1.ResourceID = t2.ManagerID
inner join
@.EmpToMan as t3
on
t2.ResourceID = t3.ManagerID
where
t1.depth +1 = 1
and
t2.depth + 1 = 2
and
t3.depth + 1 = 3
--End Block
union all
--Begin Block #5
select
5 as Tag,
4 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
t4.RLastName as [treenode!5!text],
null as [treenode!6!text],
null as [treenode!7!text],
null as [treenode!8!text],
null as [treenode!9!text],
null as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
From @.EmpToMan as t1
inner join@.EmpToMan as t2
on t1.ResourceID = t2.ManagerID
inner join @.EmpToMan as t3
on t2.ResourceID = t3.ManagerID
inner join @.EmpToMan as t4
on t3.ResourceID = t4.ManagerID
where t1.depth +1 = 1
andt2.depth + 1 = 2
and t3.depth + 1 = 3
and t4.depth + 1 = 4
--End Block
union all
--Begin Block #6
select
6 as Tag,
5 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
t4.RLastName as [treenode!5!text],
t5.RLastName as [treenode!6!text],
null as [treenode!7!text],
null as [treenode!8!text],
null as [treenode!9!text],
null as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
From @.EmpToMan as t1
inner join@.EmpToMan as t2
on t1.ResourceID = t2.ManagerID
inner join @.EmpToMan as t3
on t2.ResourceID = t3.ManagerID
inner join @.EmpToMan as t4
on t3.ResourceID = t4.ManagerID
inner join @.EmpToMan as t5
on t4.ResourceID = t5.ManagerID
where t1.depth +1 = 1
andt2.depth + 1 = 2
and t3.depth + 1 = 3
and t4.depth + 1 = 4
and t5.depth + 1 = 5
--End Block
union all
--Begin Block #7
select
7 as Tag,
6 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
t4.RLastName as [treenode!5!text],
t5.RLastName as [treenode!6!text],
t6.RLastName as [treenode!7!text],
null as [treenode!8!text],
null as [treenode!9!text],
null as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
From @.EmpToMan as t1
inner join@.EmpToMan as t2
on t1.ResourceID = t2.ManagerID
inner join @.EmpToMan as t3
on t2.ResourceID = t3.ManagerID
inner join @.EmpToMan as t4
on t3.ResourceID = t4.ManagerID
inner join @.EmpToMan as t5
on t4.ResourceID = t5.ManagerID
inner join @.EmpToMan as t6
on t5.ResourceID = t6.ManagerID
where t1.depth +1 = 1
andt2.depth + 1 = 2
and t3.depth + 1 = 3
and t4.depth + 1 = 4
and t5.depth + 1 = 5
and t6.depth + 1 = 6
--End Block
union all
--Begin Block #8
select
8 as Tag,
7 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
t4.RLastName as [treenode!5!text],
t5.RLastName as [treenode!6!text],
t6.RLastName as [treenode!7!text],
t7.RLastName as [treenode!8!text],
null as [treenode!9!text],
null as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
From @.EmpToMan as t1
inner join@.EmpToMan as t2
on t1.ResourceID = t2.ManagerID
inner join @.EmpToMan as t3
on t2.ResourceID = t3.ManagerID
inner join @.EmpToMan as t4
on t3.ResourceID = t4.ManagerID
inner join @.EmpToMan as t5
on t4.ResourceID = t5.ManagerID
inner join @.EmpToMan as t6
on t5.ResourceID = t6.ManagerID
inner join @.EmpToMan as t7
on t6.ResourceID = t7.ManagerID
where t1.depth +1 = 1
andt2.depth + 1 = 2
and t3.depth + 1 = 3
and t4.depth + 1 = 4
and t5.depth + 1 = 5
and t6.depth + 1 = 6
and t7.depth + 1 = 7
--End Block
union all
--Begin Block #9
select
9 as Tag,
8 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
t4.RLastName as [treenode!5!text],
t5.RLastName as [treenode!6!text],
t6.RLastName as [treenode!7!text],
t7.RLastName as [treenode!8!text],
t8.RLastName as [treenode!9!text],
null as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
From @.EmpToMan as t1
inner join@.EmpToMan as t2
on t1.ResourceID = t2.ManagerID
inner join @.EmpToMan as t3
on t2.ResourceID = t3.ManagerID
inner join @.EmpToMan as t4
on t3.ResourceID = t4.ManagerID
inner join @.EmpToMan as t5
on t4.ResourceID = t5.ManagerID
inner join @.EmpToMan as t6
on t5.ResourceID = t6.ManagerID
inner join @.EmpToMan as t7
on t6.ResourceID = t7.ManagerID
inner join @.EmpToMan as t8
on t7.ResourceID = t8.ManagerID
where t1.depth +1 = 1
andt2.depth + 1 = 2
and t3.depth + 1 = 3
and t4.depth + 1 = 4
and t5.depth + 1 = 5
and t6.depth + 1 = 6
and t7.depth + 1 = 7
and t8.depth + 1 = 8
--End Block
union all
--Begin Block #10
select
10 as Tag,
9 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
t4.RLastName as [treenode!5!text],
t5.RLastName as [treenode!6!text],
t6.RLastName as [treenode!7!text],
t7.RLastName as [treenode!8!text],
t8.RLastName as [treenode!9!text],
t9.RLastName as [treenode!10!text],
null as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
From @.EmpToMan as t1
inner join@.EmpToMan as t2
on t1.ResourceID = t2.ManagerID
inner join @.EmpToMan as t3
on t2.ResourceID = t3.ManagerID
inner join @.EmpToMan as t4
on t3.ResourceID = t4.ManagerID
inner join @.EmpToMan as t5
on t4.ResourceID = t5.ManagerID
inner join @.EmpToMan as t6
on t5.ResourceID = t6.ManagerID
inner join @.EmpToMan as t7
on t6.ResourceID = t7.ManagerID
inner join @.EmpToMan as t8
on t7.ResourceID = t8.ManagerID
inner join @.EmpToMan as t9
on t8.ResourceID = t9.ManagerID
where t1.depth +1 = 1
andt2.depth + 1 = 2
and t3.depth + 1 = 3
and t4.depth + 1 = 4
and t5.depth + 1 = 5
and t6.depth + 1 = 6
and t7.depth + 1 = 7
and t8.depth + 1 = 8
and t9.depth + 1 = 9
--End Block
union all
--Begin Block #11
select
11 as Tag,
10 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
t4.RLastName as [treenode!5!text],
t5.RLastName as [treenode!6!text],
t6.RLastName as [treenode!7!text],
t7.RLastName as [treenode!8!text],
t8.RLastName as [treenode!9!text],
t9.RLastName as [treenode!10!text],
t10.RLastName as [treenode!11!text],
null as [treenode!12!text],
null as [treenode!13!text]
From @.EmpToMan as t1
inner join@.EmpToMan as t2
on t1.ResourceID = t2.ManagerID
inner join @.EmpToMan as t3
on t2.ResourceID = t3.ManagerID
inner join @.EmpToMan as t4
on t3.ResourceID = t4.ManagerID
inner join @.EmpToMan as t5
on t4.ResourceID = t5.ManagerID
inner join @.EmpToMan as t6
on t5.ResourceID = t6.ManagerID
inner join @.EmpToMan as t7
on t6.ResourceID = t7.ManagerID
inner join @.EmpToMan as t8
on t7.ResourceID = t8.ManagerID
inner join @.EmpToMan as t9
on t8.ResourceID = t9.ManagerID
inner join @.EmpToMan as t10
on t9.ResourceID = t10.ManagerID
where t1.depth +1 = 1
andt2.depth + 1 = 2
and t3.depth + 1 = 3
and t4.depth + 1 = 4
and t5.depth + 1 = 5
and t6.depth + 1 = 6
and t7.depth + 1 = 7
and t8.depth + 1 = 8
and t9.depth + 1 = 9
and t10.depth + 1 = 10
--End Block
union all
--Begin Block #12
select
12 as Tag,
11 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
t4.RLastName as [treenode!5!text],
t5.RLastName as [treenode!6!text],
t6.RLastName as [treenode!7!text],
t7.RLastName as [treenode!8!text],
t8.RLastName as [treenode!9!text],
t9.RLastName as [treenode!10!text],
t10.RLastName as [treenode!11!text],
t11.RLastName as [treenode!12!text],
null as [treenode!13!text]
From @.EmpToMan as t1
inner join@.EmpToMan as t2
on t1.ResourceID = t2.ManagerID
inner join @.EmpToMan as t3
on t2.ResourceID = t3.ManagerID
inner join @.EmpToMan as t4
on t3.ResourceID = t4.ManagerID
inner join @.EmpToMan as t5
on t4.ResourceID = t5.ManagerID
inner join @.EmpToMan as t6
on t5.ResourceID = t6.ManagerID
inner join @.EmpToMan as t7
on t6.ResourceID = t7.ManagerID
inner join @.EmpToMan as t8
on t7.ResourceID = t8.ManagerID
inner join @.EmpToMan as t9
on t8.ResourceID = t9.ManagerID
inner join @.EmpToMan as t10
on t9.ResourceID = t10.ManagerID
inner join @.EmpToMan as t11
on t10.ResourceID = t11.ManagerID
where t1.depth +1 = 1
andt2.depth + 1 = 2
and t3.depth + 1 = 3
and t4.depth + 1 = 4
and t5.depth + 1 = 5
and t6.depth + 1 = 6
and t7.depth + 1 = 7
and t8.depth + 1 = 8
and t9.depth + 1 = 9
and t10.depth + 1 = 10
and t11.depth + 1 = 11
--End Block
union all
--Begin Block #13
select
13 as Tag,
12 as Parent,
null,
t1.RLastName,
t2.RLastName,
t3.RLastName as [treenode!4!text],
t4.RLastName as [treenode!5!text],
t5.RLastName as [treenode!6!text],
t6.RLastName as [treenode!7!text],
t7.RLastName as [treenode!8!text],
t8.RLastName as [treenode!9!text],
t9.RLastName as [treenode!10!text],
t10.RLastName as [treenode!11!text],
t11.RLastName as [treenode!12!text],
t12.RLastName as [treenode!13!text]
From @.EmpToMan as t1
inner join@.EmpToMan as t2
on t1.ResourceID = t2.ManagerID
inner join @.EmpToMan as t3
on t2.ResourceID = t3.ManagerID
inner join @.EmpToMan as t4
on t3.ResourceID = t4.ManagerID
inner join @.EmpToMan as t5
on t4.ResourceID = t5.ManagerID
inner join @.EmpToMan as t6
on t5.ResourceID = t6.ManagerID
inner join @.EmpToMan as t7
on t6.ResourceID = t7.ManagerID
inner join @.EmpToMan as t8
on t7.ResourceID = t8.ManagerID
inner join @.EmpToMan as t9
on t8.ResourceID = t9.ManagerID
inner join @.EmpToMan as t10
on t9.ResourceID = t10.ManagerID
inner join @.EmpToMan as t11
on t10.ResourceID = t11.ManagerID
inner join @.EmpToMan as t12
on t11.ResourceID = t12.ManagerID
where t1.depth +1 = 1
andt2.depth + 1 = 2
and t3.depth + 1 = 3
and t4.depth + 1 = 4
and t5.depth + 1 = 5
and t6.depth + 1 = 6
and t7.depth + 1 = 7
and t8.depth + 1 = 8
and t9.depth + 1 = 9
and t10.depth + 1 = 10
and t11.depth + 1 = 11
and t12.depth + 1 = 12
--End Block
order by
[TREENODES!1!text],
[treenode!2!text],
[treenode!3!text],
[treenode!4!text],
[treenode!5!text],
[treenode!6!text],
[treenode!7!text],
[treenode!8!text],
[treenode!9!text],
[treenode!10!text],
[treenode!11!text],
[treenode!12!text],
[treenode!13!text]
for xml explicit
This looks like a C# issue. Are you sure that the \ is actually part of the
data? It could be that you see \" as a way to escape the " for some C#
specific reason and that the data still only contains ". You may want to
check in a C# specific newsgroup if that does not explain it.
HTH
Michael
"rao" <jayamallik@.hotmail.com> wrote in message
news:f2ff1cc.0408251644.2bf22b62@.posting.google.co m...
> Hi
> I am running the following stored proc by executing a data set in c#.
> surprisigly I am getting data padded with extra characters.
> something like this - \"christy john"\. How to get rid of '\' this
> character.
> i try search and replace with regexp as well as string replace
> functions without luck.
>
> Here is the actual xml look like when I read from data set in c#.
> <TREENODES><treenode text=\"A/L ALLANDOO, FELIX\"/><treenode
> text=\"BEDI, RAHUL\"/><treenode text=\"CHALMERS, WILLIAM\"><treenode
> text=\"CNOSSEN, RICK\"><treenode text=\"ANKALA, PRAVEEN\"/><treenode
> text=\"BOGIA, DOUGLAS\"/><treenode text=\"COOK, HAROLD\"/><treenode
> text=\"DAILY, STEPHEN\"/><treenode text=\"GAN, XIAOCHUN\"/><treenode
> text=\"GARCEAU, PAUL\"/><treenode text=\"GOTTHARDT,
> STEVEN\"/><treenode text=\"GUPTA, MEENAKSHI\"/></TREENODES>
>
> Query analyser data in SQL SERVER looks perfectly alright without
> special
> character padding like shown beow.
> <TREENODES><treenode text="A/L ALLANDOO, FELIX"/><treenode text="BEDI,
> RAHUL"/><treenode text="CHALMERS, WILLIAM"><treenode text="CNOSSEN,
> RICK"><treenode text="ANKALA, PRAVEEN"/><treenode text="BOGIA,
> DOUGLAS"/><treenode text="COOK, HAROLD"/><treenode tex
> Please help me.
> Rao
>
> -- Here is c# code --
> ds =
> SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings[ASPNET.StarterKit.TimeTracker.Web.Global. CfgKeyConnString],
> SPname);
> System.IO.StringWriter strWriter = new StringWriter();
> ds.WriteXml(strWriter);
> strXML = strWriter.ToString();
> --Here is stored procedure and c# code--
> dbo.ResourceXMLTest
> as
> set nocount on
> --Take out the next block and make this SP accept
> --a variable table like it does for @.EmpToMan
> SET CONCAT_NULL_YIELDS_NULL OFF
> Declare @.EmpToMan table(
> ResourceID int,
> ManagerID int,
> Depth int,
> Lineage nvarchar(256),
> ResourceWWID numeric(19),
> RFirstName nvarchar(50),
> RLastName nvarchar(50)
> )
> INSERT INTO @.EmpToMan
> SELECT
> E.EmployeeID,
> E.ManagerID,
> E.Depth,
> E.Lineage,
> R.WWID,
> R.FirstName ,
> R.LastName + ', ' + R.FirstName
> --R.LastName + ', ' + R.FirstName
> FROM
> Resources R left outer join EmployeeToManager E
> ON r.resourceID = E.EmployeeID
> select
> 1 as Tag,
> 0 as Parent,
> null as [TREENODES!1!text],
> null as [treenode!2!text],
> null as [treenode!3!text],
> null as [treenode!4!text],
> null as [treenode!5!text],
> null as [treenode!6!text],
> null as [treenode!7!text],
> null as [treenode!8!text],
> null as [treenode!9!text],
> null as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> union all
> select
> 2 as Tag,
> 1 as Parent,
> null,
> RLastName as [treenode!2!text],
> null as [treenode!3!text],
> null as [treenode!4!text],
> null as [treenode!5!text],
> null as [treenode!6!text],
> null as [treenode!7!text],
> null as [treenode!8!text],
> null as [treenode!9!text],
> null as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> from
> @.EmpToMan
> where
> Depth + 1 = 1
> union
> all
> select
> 3 as Tag,
> 2 as Parent,
> null,
> t1.RLastName,
> t2.RLastName as [treenode!3!text],
> null as [treenode!4!text],
> null as [treenode!5!text],
> null as [treenode!6!text],
> null as [treenode!7!text],
> null as [treenode!8!text],
> null as [treenode!9!text],
> null as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> from
> @.EmpToMan as t1
> inner join
> @.EmpToMan as t2
> on
> t1.ResourceID = t2.ManagerID
> where
> t1.depth + 1 = 1
> and
> t2.depth + 1 = 2
> union
> all
> --Begin Block #4
> select
> 4 as Tag,
> 3 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> null as [treenode!5!text],
> null as [treenode!6!text],
> null as [treenode!7!text],
> null as [treenode!8!text],
> null as [treenode!9!text],
> null as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> From
> @.EmpToMan as t1
> inner join
> @.EmpToMan as t2
> on
> t1.ResourceID = t2.ManagerID
> inner join
> @.EmpToMan as t3
> on
> t2.ResourceID = t3.ManagerID
> where
> t1.depth +1 = 1
> and
> t2.depth + 1 = 2
> and
> t3.depth + 1 = 3
> --End Block
> union all
> --Begin Block #5
> select
> 5 as Tag,
> 4 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> t4.RLastName as [treenode!5!text],
> null as [treenode!6!text],
> null as [treenode!7!text],
> null as [treenode!8!text],
> null as [treenode!9!text],
> null as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> From @.EmpToMan as t1
> inner join @.EmpToMan as t2
> on t1.ResourceID = t2.ManagerID
> inner join @.EmpToMan as t3
> on t2.ResourceID = t3.ManagerID
> inner join @.EmpToMan as t4
> on t3.ResourceID = t4.ManagerID
> where t1.depth +1 = 1
> and t2.depth + 1 = 2
> and t3.depth + 1 = 3
> and t4.depth + 1 = 4
> --End Block
> union all
> --Begin Block #6
> select
> 6 as Tag,
> 5 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> t4.RLastName as [treenode!5!text],
> t5.RLastName as [treenode!6!text],
> null as [treenode!7!text],
> null as [treenode!8!text],
> null as [treenode!9!text],
> null as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> From @.EmpToMan as t1
> inner join @.EmpToMan as t2
> on t1.ResourceID = t2.ManagerID
> inner join @.EmpToMan as t3
> on t2.ResourceID = t3.ManagerID
> inner join @.EmpToMan as t4
> on t3.ResourceID = t4.ManagerID
> inner join @.EmpToMan as t5
> on t4.ResourceID = t5.ManagerID
> where t1.depth +1 = 1
> and t2.depth + 1 = 2
> and t3.depth + 1 = 3
> and t4.depth + 1 = 4
> and t5.depth + 1 = 5
> --End Block
> union all
> --Begin Block #7
> select
> 7 as Tag,
> 6 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> t4.RLastName as [treenode!5!text],
> t5.RLastName as [treenode!6!text],
> t6.RLastName as [treenode!7!text],
> null as [treenode!8!text],
> null as [treenode!9!text],
> null as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> From @.EmpToMan as t1
> inner join @.EmpToMan as t2
> on t1.ResourceID = t2.ManagerID
> inner join @.EmpToMan as t3
> on t2.ResourceID = t3.ManagerID
> inner join @.EmpToMan as t4
> on t3.ResourceID = t4.ManagerID
> inner join @.EmpToMan as t5
> on t4.ResourceID = t5.ManagerID
> inner join @.EmpToMan as t6
> on t5.ResourceID = t6.ManagerID
> where t1.depth +1 = 1
> and t2.depth + 1 = 2
> and t3.depth + 1 = 3
> and t4.depth + 1 = 4
> and t5.depth + 1 = 5
> and t6.depth + 1 = 6
> --End Block
> union all
> --Begin Block #8
> select
> 8 as Tag,
> 7 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> t4.RLastName as [treenode!5!text],
> t5.RLastName as [treenode!6!text],
> t6.RLastName as [treenode!7!text],
> t7.RLastName as [treenode!8!text],
> null as [treenode!9!text],
> null as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> From @.EmpToMan as t1
> inner join @.EmpToMan as t2
> on t1.ResourceID = t2.ManagerID
> inner join @.EmpToMan as t3
> on t2.ResourceID = t3.ManagerID
> inner join @.EmpToMan as t4
> on t3.ResourceID = t4.ManagerID
> inner join @.EmpToMan as t5
> on t4.ResourceID = t5.ManagerID
> inner join @.EmpToMan as t6
> on t5.ResourceID = t6.ManagerID
> inner join @.EmpToMan as t7
> on t6.ResourceID = t7.ManagerID
> where t1.depth +1 = 1
> and t2.depth + 1 = 2
> and t3.depth + 1 = 3
> and t4.depth + 1 = 4
> and t5.depth + 1 = 5
> and t6.depth + 1 = 6
> and t7.depth + 1 = 7
> --End Block
> union all
> --Begin Block #9
> select
> 9 as Tag,
> 8 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> t4.RLastName as [treenode!5!text],
> t5.RLastName as [treenode!6!text],
> t6.RLastName as [treenode!7!text],
> t7.RLastName as [treenode!8!text],
> t8.RLastName as [treenode!9!text],
> null as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> From @.EmpToMan as t1
> inner join @.EmpToMan as t2
> on t1.ResourceID = t2.ManagerID
> inner join @.EmpToMan as t3
> on t2.ResourceID = t3.ManagerID
> inner join @.EmpToMan as t4
> on t3.ResourceID = t4.ManagerID
> inner join @.EmpToMan as t5
> on t4.ResourceID = t5.ManagerID
> inner join @.EmpToMan as t6
> on t5.ResourceID = t6.ManagerID
> inner join @.EmpToMan as t7
> on t6.ResourceID = t7.ManagerID
> inner join @.EmpToMan as t8
> on t7.ResourceID = t8.ManagerID
> where t1.depth +1 = 1
> and t2.depth + 1 = 2
> and t3.depth + 1 = 3
> and t4.depth + 1 = 4
> and t5.depth + 1 = 5
> and t6.depth + 1 = 6
> and t7.depth + 1 = 7
> and t8.depth + 1 = 8
> --End Block
> union all
>
> --Begin Block #10
> select
> 10 as Tag,
> 9 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> t4.RLastName as [treenode!5!text],
> t5.RLastName as [treenode!6!text],
> t6.RLastName as [treenode!7!text],
> t7.RLastName as [treenode!8!text],
> t8.RLastName as [treenode!9!text],
> t9.RLastName as [treenode!10!text],
> null as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> From @.EmpToMan as t1
> inner join @.EmpToMan as t2
> on t1.ResourceID = t2.ManagerID
> inner join @.EmpToMan as t3
> on t2.ResourceID = t3.ManagerID
> inner join @.EmpToMan as t4
> on t3.ResourceID = t4.ManagerID
> inner join @.EmpToMan as t5
> on t4.ResourceID = t5.ManagerID
> inner join @.EmpToMan as t6
> on t5.ResourceID = t6.ManagerID
> inner join @.EmpToMan as t7
> on t6.ResourceID = t7.ManagerID
> inner join @.EmpToMan as t8
> on t7.ResourceID = t8.ManagerID
> inner join @.EmpToMan as t9
> on t8.ResourceID = t9.ManagerID
> where t1.depth +1 = 1
> and t2.depth + 1 = 2
> and t3.depth + 1 = 3
> and t4.depth + 1 = 4
> and t5.depth + 1 = 5
> and t6.depth + 1 = 6
> and t7.depth + 1 = 7
> and t8.depth + 1 = 8
> and t9.depth + 1 = 9
> --End Block
> union all
> --Begin Block #11
> select
> 11 as Tag,
> 10 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> t4.RLastName as [treenode!5!text],
> t5.RLastName as [treenode!6!text],
> t6.RLastName as [treenode!7!text],
> t7.RLastName as [treenode!8!text],
> t8.RLastName as [treenode!9!text],
> t9.RLastName as [treenode!10!text],
> t10.RLastName as [treenode!11!text],
> null as [treenode!12!text],
> null as [treenode!13!text]
> From @.EmpToMan as t1
> inner join @.EmpToMan as t2
> on t1.ResourceID = t2.ManagerID
> inner join @.EmpToMan as t3
> on t2.ResourceID = t3.ManagerID
> inner join @.EmpToMan as t4
> on t3.ResourceID = t4.ManagerID
> inner join @.EmpToMan as t5
> on t4.ResourceID = t5.ManagerID
> inner join @.EmpToMan as t6
> on t5.ResourceID = t6.ManagerID
> inner join @.EmpToMan as t7
> on t6.ResourceID = t7.ManagerID
> inner join @.EmpToMan as t8
> on t7.ResourceID = t8.ManagerID
> inner join @.EmpToMan as t9
> on t8.ResourceID = t9.ManagerID
> inner join @.EmpToMan as t10
> on t9.ResourceID = t10.ManagerID
> where t1.depth +1 = 1
> and t2.depth + 1 = 2
> and t3.depth + 1 = 3
> and t4.depth + 1 = 4
> and t5.depth + 1 = 5
> and t6.depth + 1 = 6
> and t7.depth + 1 = 7
> and t8.depth + 1 = 8
> and t9.depth + 1 = 9
> and t10.depth + 1 = 10
> --End Block
> union all
> --Begin Block #12
> select
> 12 as Tag,
> 11 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> t4.RLastName as [treenode!5!text],
> t5.RLastName as [treenode!6!text],
> t6.RLastName as [treenode!7!text],
> t7.RLastName as [treenode!8!text],
> t8.RLastName as [treenode!9!text],
> t9.RLastName as [treenode!10!text],
> t10.RLastName as [treenode!11!text],
> t11.RLastName as [treenode!12!text],
> null as [treenode!13!text]
> From @.EmpToMan as t1
> inner join @.EmpToMan as t2
> on t1.ResourceID = t2.ManagerID
> inner join @.EmpToMan as t3
> on t2.ResourceID = t3.ManagerID
> inner join @.EmpToMan as t4
> on t3.ResourceID = t4.ManagerID
> inner join @.EmpToMan as t5
> on t4.ResourceID = t5.ManagerID
> inner join @.EmpToMan as t6
> on t5.ResourceID = t6.ManagerID
> inner join @.EmpToMan as t7
> on t6.ResourceID = t7.ManagerID
> inner join @.EmpToMan as t8
> on t7.ResourceID = t8.ManagerID
> inner join @.EmpToMan as t9
> on t8.ResourceID = t9.ManagerID
> inner join @.EmpToMan as t10
> on t9.ResourceID = t10.ManagerID
> inner join @.EmpToMan as t11
> on t10.ResourceID = t11.ManagerID
> where t1.depth +1 = 1
> and t2.depth + 1 = 2
> and t3.depth + 1 = 3
> and t4.depth + 1 = 4
> and t5.depth + 1 = 5
> and t6.depth + 1 = 6
> and t7.depth + 1 = 7
> and t8.depth + 1 = 8
> and t9.depth + 1 = 9
> and t10.depth + 1 = 10
> and t11.depth + 1 = 11
> --End Block
> union all
> --Begin Block #13
> select
> 13 as Tag,
> 12 as Parent,
> null,
> t1.RLastName,
> t2.RLastName,
> t3.RLastName as [treenode!4!text],
> t4.RLastName as [treenode!5!text],
> t5.RLastName as [treenode!6!text],
> t6.RLastName as [treenode!7!text],
> t7.RLastName as [treenode!8!text],
> t8.RLastName as [treenode!9!text],
> t9.RLastName as [treenode!10!text],
> t10.RLastName as [treenode!11!text],
> t11.RLastName as [treenode!12!text],
> t12.RLastName as [treenode!13!text]
> From @.EmpToMan as t1
> inner join @.EmpToMan as t2
> on t1.ResourceID = t2.ManagerID
> inner join @.EmpToMan as t3
> on t2.ResourceID = t3.ManagerID
> inner join @.EmpToMan as t4
> on t3.ResourceID = t4.ManagerID
> inner join @.EmpToMan as t5
> on t4.ResourceID = t5.ManagerID
> inner join @.EmpToMan as t6
> on t5.ResourceID = t6.ManagerID
> inner join @.EmpToMan as t7
> on t6.ResourceID = t7.ManagerID
> inner join @.EmpToMan as t8
> on t7.ResourceID = t8.ManagerID
> inner join @.EmpToMan as t9
> on t8.ResourceID = t9.ManagerID
> inner join @.EmpToMan as t10
> on t9.ResourceID = t10.ManagerID
> inner join @.EmpToMan as t11
> on t10.ResourceID = t11.ManagerID
> inner join @.EmpToMan as t12
> on t11.ResourceID = t12.ManagerID
> where t1.depth +1 = 1
> and t2.depth + 1 = 2
> and t3.depth + 1 = 3
> and t4.depth + 1 = 4
> and t5.depth + 1 = 5
> and t6.depth + 1 = 6
> and t7.depth + 1 = 7
> and t8.depth + 1 = 8
> and t9.depth + 1 = 9
> and t10.depth + 1 = 10
> and t11.depth + 1 = 11
> and t12.depth + 1 = 12
> --End Block
> order by
> [TREENODES!1!text],
> [treenode!2!text],
> [treenode!3!text],
> [treenode!4!text],
> [treenode!5!text],
> [treenode!6!text],
> [treenode!7!text],
> [treenode!8!text],
> [treenode!9!text],
> [treenode!10!text],
> [treenode!11!text],
> [treenode!12!text],
> [treenode!13!text]
> for xml explicit
|||Hi Michael,
Yes it is esacape character actually shown like this "\" as part of
data,
The ascii value of it is 34. In the debugger it shows as '"'. I need
to find out how to replace '"'with " double quotes.
I was able to replace with single quotes and empty strings. I am
getting
syntax errors while replacing with double quote.
for example tempstr=Regex.Replace(tempstr,Convert.ToString('"' ),"")
would produce the result some thing like this - text=A/L ALLANDOO,
FELIX\
But I need the result as look like this - text="A/L ALLANDOO, FELIX"\
Looking for some help.
Thanks
Rao
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> wrote in message news:<#HUyLPyiEHA.2140@.TK2MSFTNGP15.phx.gbl>...[vbcol=seagreen]
> This looks like a C# issue. Are you sure that the \ is actually part of the
> data? It could be that you see \" as a way to escape the " for some C#
> specific reason and that the data still only contains ". You may want to
> check in a C# specific newsgroup if that does not explain it.
> HTH
> Michael
> "rao" <jayamallik@.hotmail.com> wrote in message
> news:f2ff1cc.0408251644.2bf22b62@.posting.google.co m...

Sunday, February 26, 2012

For replication gurus

Hi
I dont want to use built in replication mechanism in sql 2005.
Reason:
Two servers that need to be synchronised, 95% from A to B and 5% from B
to A, are located in two different cities and the internet connection
is not vey reliable.
Is there an alternative.
I was thinking of monitoring all changes by datestimetamp and then
prepare a huge composite sql statement for the changes and email this
text file to the other server where it would be executed. This would
be done once everyday.
If someone has a better solution i will really appreciate to know the
details.
Thanks in advance.
Newish
Hi
Well , have you looked into linked servers in the BOL?
"Newish" <ahussain3@.gmail.com> wrote in message
news:1163517504.861790.68990@.m73g2000cwd.googlegro ups.com...
> Hi
> I dont want to use built in replication mechanism in sql 2005.
> Reason:
> Two servers that need to be synchronised, 95% from A to B and 5% from B
> to A, are located in two different cities and the internet connection
> is not vey reliable.
> Is there an alternative.
> I was thinking of monitoring all changes by datestimetamp and then
> prepare a huge composite sql statement for the changes and email this
> text file to the other server where it would be executed. This would
> be done once everyday.
> If someone has a better solution i will really appreciate to know the
> details.
> Thanks in advance.
> Newish
>
|||This will work for updates and inserts, but what about your deletes?
If you are trying to merge data from two servers where the data is in the
same tables you will need to do some sort of auditing based on PK info. IE
an audit table for each table you are merging which contains the pk of the
row modified an indicator as to whether it is an update, insert or delete
and then use triggers to write to these audit tables. Then you need to be
able to handle the condition where a row is updated on one side and deleted
on the other, as well as PK collisions.
It gets complex very quickly. Merge replication is designed for scenarios
like this.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Newish" <ahussain3@.gmail.com> wrote in message
news:1163517504.861790.68990@.m73g2000cwd.googlegro ups.com...
> Hi
> I dont want to use built in replication mechanism in sql 2005.
> Reason:
> Two servers that need to be synchronised, 95% from A to B and 5% from B
> to A, are located in two different cities and the internet connection
> is not vey reliable.
> Is there an alternative.
> I was thinking of monitoring all changes by datestimetamp and then
> prepare a huge composite sql statement for the changes and email this
> text file to the other server where it would be executed. This would
> be done once everyday.
> If someone has a better solution i will really appreciate to know the
> details.
> Thanks in advance.
> Newish
>
|||I agree with Hilary.
BTW merge replication is resilient to the connection being dropped, and you
can optimise the profile for this occasion.
I have replicated to ships where the satellite comms are repeatedly dropped
when there are large waves that obscure the transmitter/receiver, and there
can't be too many more demanding replication setups than this, yet the merge
synchronization proved robust.
Alternative solutions eg DataCompare are available, but you'd have to
program much of the functionality that comes for free with merge
replication.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Thanks for your responses.
Exactly what happens if the line drops. Is everything rolled back. Is
the merge transaction based.
Regards
Newish
Paul Ibison wrote:

> I agree with Hilary.
> BTW merge replication is resilient to the connection being dropped, and you
> can optimise the profile for this occasion.
> I have replicated to ships where the satellite comms are repeatedly dropped
> when there are large waves that obscure the transmitter/receiver, and there
> can't be too many more demanding replication setups than this, yet the merge
> synchronization proved robust.
> Alternative solutions eg DataCompare are available, but you'd have to
> program much of the functionality that comes for free with merge
> replication.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||The transaction for processing the current row will get rolled back, but the
unprocessed changes in the batch will get reapplied when the merge agent
next runs.
This'll change to encompass >1 row if you are using logical records.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

For replication gurus

Hi
I dont want to use built in replication mechanism in sql 2005.
Reason:
Two servers that need to be synchronised, 95% from A to B and 5% from B
to A, are located in two different cities and the internet connection
is not vey reliable.
Is there an alternative.
I was thinking of monitoring all changes by datestimetamp and then
prepare a huge composite sql statement for the changes and email this
text file to the other server where it would be executed. This would
be done once everyday.
If someone has a better solution i will really appreciate to know the
details.
Thanks in advance.
NewishHi
Well , have you looked into linked servers in the BOL?
"Newish" <ahussain3@.gmail.com> wrote in message
news:1163517504.861790.68990@.m73g2000cwd.googlegroups.com...
> Hi
> I dont want to use built in replication mechanism in sql 2005.
> Reason:
> Two servers that need to be synchronised, 95% from A to B and 5% from B
> to A, are located in two different cities and the internet connection
> is not vey reliable.
> Is there an alternative.
> I was thinking of monitoring all changes by datestimetamp and then
> prepare a huge composite sql statement for the changes and email this
> text file to the other server where it would be executed. This would
> be done once everyday.
> If someone has a better solution i will really appreciate to know the
> details.
> Thanks in advance.
> Newish
>|||This will work for updates and inserts, but what about your deletes?
If you are trying to merge data from two servers where the data is in the
same tables you will need to do some sort of auditing based on PK info. IE
an audit table for each table you are merging which contains the pk of the
row modified an indicator as to whether it is an update, insert or delete
and then use triggers to write to these audit tables. Then you need to be
able to handle the condition where a row is updated on one side and deleted
on the other, as well as PK collisions.
It gets complex very quickly. Merge replication is designed for scenarios
like this.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Newish" <ahussain3@.gmail.com> wrote in message
news:1163517504.861790.68990@.m73g2000cwd.googlegroups.com...
> Hi
> I dont want to use built in replication mechanism in sql 2005.
> Reason:
> Two servers that need to be synchronised, 95% from A to B and 5% from B
> to A, are located in two different cities and the internet connection
> is not vey reliable.
> Is there an alternative.
> I was thinking of monitoring all changes by datestimetamp and then
> prepare a huge composite sql statement for the changes and email this
> text file to the other server where it would be executed. This would
> be done once everyday.
> If someone has a better solution i will really appreciate to know the
> details.
> Thanks in advance.
> Newish
>|||I agree with Hilary.
BTW merge replication is resilient to the connection being dropped, and you
can optimise the profile for this occasion.
I have replicated to ships where the satellite comms are repeatedly dropped
when there are large waves that obscure the transmitter/receiver, and there
can't be too many more demanding replication setups than this, yet the merge
synchronization proved robust.
Alternative solutions eg DataCompare are available, but you'd have to
program much of the functionality that comes for free with merge
replication.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .|||Thanks for your responses.
Exactly what happens if the line drops. Is everything rolled back. Is
the merge transaction based.
Regards
Newish
Paul Ibison wrote:

> I agree with Hilary.
> BTW merge replication is resilient to the connection being dropped, and yo
u
> can optimise the profile for this occasion.
> I have replicated to ships where the satellite comms are repeatedly droppe
d
> when there are large waves that obscure the transmitter/receiver, and ther
e
> can't be too many more demanding replication setups than this, yet the mer
ge
> synchronization proved robust.
> Alternative solutions eg DataCompare are available, but you'd have to
> program much of the functionality that comes for free with merge
> replication.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .|||The transaction for processing the current row will get rolled back, but the
unprocessed changes in the batch will get reapplied when the merge agent
next runs.
This'll change to encompass >1 row if you are using logical records.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Sunday, February 19, 2012

Footer with a dynamic amount of Textboxes with dynamic Textbox Properties

Hi!

I have to create a report with an footer that has different layouts. This depends on a parameter. So for example the parameter is "1" there must be 4 Textboxes with a special location, font, width, height, text and so on. If the parameter is "2" there must be only 2 Textboxes. If Parameter is "3" ... and so on

Does there exists a solution for my problem?

Thanks in advance!Hi! Here I am again...

The following ideas are failed:

- Creating a subreport in footer (tried to trick the UI -> using XML Code->failed with preview)
- Delete the footer and put a table on the bottom of the body with a subbreport that includes the different textboxes (this is not a really footer)
- using a picture with a picture format of a pdf file (doesnt work) or a vector picture (unfortunately bitmaps or jpegs are rendered in bad quality in pdf)

My idea would be the following:
- putting the max amount of the needed textboxes in the footer and create for each Textproperty a switch statement that depends on the parameter
for example: TextBox property width: =Switch(Paramter="1", "10cm", Parameter="2","2cm")
and this for each each TextBox property.

This is a circumstantial way in my opinion.|||has nobody an idea for my problem? Or can someone suggest me another forum?