Sunday, March 25, 2012
Do I need recursion ?
right, the scenario.
A web Blog
blogger1 posts a blog_entry, e.g I love the simpsons
blogger2 comments on that blog_entry, e.g No, I hate the simpsons
Blogger3 comments on that comment, ie, How can you hate the simpsons.
so you can comment on a comment on a comment etc.. lool.
right, i have got two tables... Blog_entry & comment. i need to be able to search for a blog_entry + all the comments on that blog_entry..
at the moment i can search for the comments on the blog_entry using the FK in the comment table.
blog_entry
INSERT INTO Blog_Entry VALUES(0001,'I love the Simpsons');
comments
INSERT INTO Comment VALUES(0001,' No I hate the simpsons, cID 1000);
but i need to be able to search for the comments on comments
INSERT INTO Comment VALUES(0001,' How can you hate the simpsons, cID1000);
hopefully you can see the problem here, with only one comments table how can i get the search for the comment on the comment.. theres nothing linking them...
I could make a sub comments table, and use a FK (as with the blog_entry & first comment)
but then I would have to make another sub sub table to be able to get those comments on the first sub table... this would go on and on for each comment on comment.
you can see the cID1000 (comment PK) I can't use this to get the comment because its duplicating the PK...
So, I need to be able to search for the comments on comments eg. I need to be able to search for blogger2, and any comments that were made on his comments.
Someone I know mention using recursion to get the comment on comment info, is this right ?
Hehe, I hope you understand what im asking here the is my first exploration of SQL, so any tips, hints, would be most welcome.
Thanks loads
PS: if there anything you dont understand about what I have written, or what im asking please say so
Spence.you could actually do it with just one table
when you add a comment, add also the id of the original entry
thus when you add a comment on a comment, the original entry id is available, so you can add it to the comment on the comment too
then to retrieve all comments, and comments on comments, for a specific entry, it's just a simple WHERE originalentry=5
so recursion is not required|||you could actually do it with just one table
when you add a comment, add also the id of the original entry
thus when you add a comment on a comment, the original entry id is available, so you can add it to the comment on the comment too
then to retrieve all comments, and comments on comments, for a specific entry, it's just a simple WHERE originalentry=5
so recursion is not required
Hi rudy, thank you very much for your input here.
using one table, I take it you mean just use the Blog_entry tbl, as the attributes in the blog_entry & comment tbls are the same.. the only difference is the actual text...
but, If i were to add to original entryId in the new comment tuple (But in the same table) it would break the PK constraint, there would be duplicate blog_entryID's.. So i need to keep both the comments and the Blog_entry tables seperate..
To able to make a comment on a comment, dont i need something to identify each individual comment ? if so, then im back to square one...
sheesh, this is confusing...|||yikes! (can't read it, not sure i need to, though)
yes you can do it in one table, but you don't have to
create table entries
( id integer not null primary key auto_increment
, name varchar(255) not null
, unique index entriespk (name)
, thread integer null
, foreign key threadstarter (thread) references entries (id)
, replyto integer null
, foreign key replytothread (replyto) references entries (id)
, entry text
);
entries that start a new thread have both thread and replyto NULL
when you reply to an entry, you link to it via replyto, and via thread to the id of the original entry which started the thread
(so replies to the original new entry have the same id in thread and replyto)|||yikes! (can't read it, not sure i need to, though)
yes you can do it in one table, but you don't have to
create table entries
( id integer not null primary key auto_increment
, name varchar(255) not null
, unique index entriespk (name)
, thread integer null
, foreign key threadstarter (thread) references entries (id)
, replyto integer null
, foreign key replytothread (replyto) references entries (id)
, entry text
);
entries that start a new thread have both thread and replyto NULL
when you reply to an entry, you link to it via replyto, and via thread to the id of the original entry which started the thread
(so replies to the original new entry have the same id in thread and replyto)
LoooL rudy,
Cheers for the help m8..
Sweet stuff!
Have a good day.|||The problem is an hierarchical one, each comment has exactly one parent (except the original thread), and 0 to n childs. The standard approach to store such facts is a recursive one, as shown by Rudy. Such a structure, however, isn't to query using standard SQL.
Usual solutions for this are
* recursive T-SQL stored procedure
* bridging
Acutally, the solution presented here, is a bridge solution, however, just a bridge to the original thread. To be able to sort on (sub)threads and to format the solution (e.g. by using indents) youwill need to have the complete path. This is, of cource, redundant, but not a problem because such a path will not change,so there is no danger for inconsistency.
If you can estimate the maximum deepth of a discussion, you can make a structure acoordingly. If you can't, you may also consider to store your information without the path, but dynamically create a temp table with your actual path length and put the data in it for presentation.
I hope I made myself sufficiently clear.|||the solution presented here did not (yet) include queries, so i don't understand why it's a "bridge" solution -- it is a classic hierarchical solution capable of supporting true recursion
further, one does not need to store the path (and i have not allowed for it), so the redundancy only comes into the design if you want it to come into the design, and i don't
further, i am not going to argue whether the thread column (which points from every comment in a thread, no matter at what level, to the thread starter) is redundant, because it isn't
but i agree whole-heartedly about knowing the maximum depth -- this allows you to write a query consisting of N self-joins, which means that no matter where you are in the hierarchy, you can get all nodes below the node you're on, with indentation, in one single query, without a temp table
recursion and/or temp tables are only required if you do not know the maximum depth in the entire hierarchy|||but i agree whole-heartedly about knowing the maximum depth -- this allows you to write a query consisting of N self-joins, which means that no matter where you are in the hierarchy, you can get all nodes below the node you're on, with indentation, in one single query, without a temp table
recursion and/or temp tables are only required if you do not know the maximum depth in the entire hierarchy
I agree on this as a third option.
further, i am not going to argue whether the thread column (which points from every comment in a thread, no matter at what level, to the thread starter) is redundant, because it isn't
Why not? You can get it by recursively selecting the parent of a comment, or not? However, redundancy isn't the problem here, I would even add the entire path by having 1st level comment, 2nd level comment, 3rd le... etc. The problem is the presentation of hierarchical data.|||just because you can get the thread starter recursively does not make it redundant
also, you can achieve indentation without storing the path, by using the N-level self-join|||just because you can get the thread starter recursively does not make it redundant
Then, with all respect, you have your own, wrong definiton of redundancy, see Definition Redundancy (http://www.hyperdictionary.com/search.aspx?define=redundancy)
But, again, I don't have a problem with redundancy here, since a discussion branche will not be moved, probably. My point is, however, to make either the whole path redundant, or nothing and solve it in this case with other means (N views if you know the maximum deepth, or with a recursive T-SQL procedure). Just to have a reference to the root thread will not help at all.
Please note, that my proposal to store the whole path, is something similiar to your N-View approach with the difference, that the complexitity of your execution plan multiplies with every additional level, while the complexity of my execution plan is almost liniar growing.|||heh, that's pretty amusing, citing a dictionary as an authoritative reference for a relational database concept
the reference to the root thread does so help, if you wanted to quickly list all the ids and titles within a thread without regard to indentation
the complexity of my self-join-N-times does not grow at all, unless you change N, which is assumed to be the maximum depth, and if you change the maximum depth, then it's not a maximum, is it
i do realize that storing the path has certain benefits, i just do not happen to value them over my method
for more on paths, read this thread (http://www.sitepoint.com/forums/showthread.php?t=84833)
in fact, one of the participants in that thread has a tutorial on his method here:
Multi-Threaded Message Board Solution (Hierarchical Data without the Adjacency Model) (http://morgankelsey.com/code/multi-threaded_board/)|||heh, that's pretty amusing, citing a dictionary as an authoritative reference for a relational database concept
I hope that - beside the entainment - you got my point: if the same fact (root of a comment) is stored twice (both as [Thread] and [ReplyTo]), it is redundant!
the reference to the root thread does so help, if you wanted to quickly list all the ids and titles within a thread without regard to indentation
... and structure. You can, of cource, sort by time of ID to list all comments in chronological order, but you can't help the user to detect the mutual relationships, except by printing IDs and let the user puzzle by himself.
the complexity of my self-join-N-times does not grow at all, unless you change N, which is assumed to be the maximum depth, and if you change the maximum depth, then it's not a maximum, is it
Please see my previous comment. My point was that the complexity of your preferred solution depends on N.
i do realize that storing the path has certain benefits, i just do not happen to value them over my method
Okay, we don't need to agree in our recommendations, as long as the poster gets a picture of the possiblities and can choose the one fitting to his needs.
for more on paths, read this thread (http://www.sitepoint.com/forums/showthread.php?t=84833)
in fact, one of the participants in that thread has a tutorial on his method here:
Multi-Threaded Message Board Solution (Hierarchical Data without the Adjacency Model) (http://morgankelsey.com/code/multi-threaded_board/)
I took a look, and storing the comment level is a manner to get at least the indentation. To present the thread with its comment-on-comment rel;ationships, however, this method still needs recursion, while my proposal of storing the whole path is non-recursive.
I guess we made our solutions sufficiently clear for the poster; I'm curious of Spencers reaction.|||if the same fact (root of a comment) is stored twice (both as [Thread] and [ReplyTo]), it is redundant!Thread and ReplyTo aren't the same fact!!
:) :) :)|||Either you or me are making a considerable thinking mistake. Please see the following example, just getting three fields: ID, Thread, ReplyTo
1,null,null
2,1,1
3,1,2
In the second row, Thread=ReplyTo
In the third row: Thread = ReplyTo of ReplyTo
In both cases, Thread can be derived from ReplyTo, so it is stored twice, which is called redundant storage.|||please apply 1NF, 2NF, 3NF rules to this example: (ID, Thread, ReplyTo)
i'd be interested to know when it violates an actual normalization rule, not a doktorblue "it looks redundant to me" normalization rule|||From the normalization point of view, your model isn't in the 3rd nf:
A table is in 3NF if: It is in 2NF and it contains no transitive dependencies.
The Thread depends transitively on the ReplyTo. You can remove the Thread column without removing the Thread information.|||you misunderstand transitivity, it does not work across rows, it is a rule for columns within a row|||Do either of you see the humor or irony in trading post after post on the subject of redundancy? ;)|||I don't anymore ... :cool:|||i see the irony, but not the humour
:)
okay, another recursion example
- each employee row contains the foreign key of his/her supervisor
- each employee must work in the same department as his/her supervisor
where would you store the information about which department an employee is in?|||There is just one employee table, containing employees and their supervisiors, right?! I would store the department information in a associative entity DepEmp(DepID, EmpID), containing just the employess which are the bosses of their department. However, I'm not sure whether this will work nice, so I'd probably add some redundancy here by
* repeating the department for every employee
* or adding a reference to every department boss to every employee
What had you in mind?|||thank you, doktorblue, you have just copied my design for the threads
* repeating the [department]thread for every [employee]post
* or adding a reference to every [department boss]thread starter to every [employee]post
i'm sure this will "work nice" as you say, even though you yourself don't like it because it's "redundant"|||Do you realize that you are admitting that your design contains redundancy?
Regarding my "work nice" comment: the final structure heavely depends on the usage. If you are frequently using the entire suipervisor hierarchy, you will get another design than if you are using only the direct supervisor and department information. If you don't use regularly department information, I would not even consider to duplicate the data.|||no, i do not realize it, because as i said earlier, there is no redundancy
but it is very nice to see you adopt the same design
:) :) :)|||So, according to your logica, the total order amount on order level isn't redundant with the sum of the amount of indivudual order lines? Its not on the same row, is it? I guess 1st class informatica students can tell you better.
Or, according to your same logica, the following table isn't inconsistent, because inconsistency can only happen if there is redundant data
ID, ReplyTo, Thread
1, null, null
2, 1, 1
3, 1, 2
Comment 3, however, belongs to both thread 1 and 2, which can't be.
I hope for you, or better for your clients, that they don't have any complex problems with redundancy.|||inconsistency can only happen if there is redundant dataonly? inconsistency can happen without redundancy, too
if the database cannot enforce the consistency rules, then the application developer had better assume this responsibility
are you suggesting i am not a good enough developer to cover for the weaknesses of current database products?
;)
you know what, doktorblue? i like you
i like you a lot
i like the way you think
you are going on my buddy list
:cool:|||you know what, doktorblue? i like you
i like you a lot
i like the way you think
you are going on my buddy list
:cool:
Don't get personal, will you?!
:D|||What!? That's it?
C'mon, please start fighting again. It's so refreshing for us Yanks to watch an international conflict in which we AREN'T involved...|||Ha Rudy, there is somebody asking for troubles! Let's get him!
:D:D|||the blindman is actually one o' the good guys
he has helped me a hunnert times
:cool:|||Ha! Bullcr@.p! You haven't needed help. But nice of you to say, though. I like posting on this board and I've learned a lot from reading everybody's posts, especially yours.|||Oh heck, I can usually get Rudy pretty riled up. Maybe we can get this show back on the road if I can find the appropriate taunt...
Heavens, it was just getting fun, watching the "mud cannons" getting loaded with huge quantities of various forms of "organic fertilizer" on both sides of the Atlantic!
-PatP|||Oh, its easy to get Rudy riled. You know those Canadians have no sense of humor. That's why all their decent comics come down here to the U S of A.
Now, as far as jibes at people from the Netherlands...I'm drawing a complete blank. What do they do over there, anyway?|||Now, as far as jibes at people from the Netherlands...I'm drawing a complete blank. What do they do over there, anyway?Diamonds, drugs, sex, and flowers for the most part. Delft does gorgeous porcelin.
I don't want to get them riled up personally though, I want to keep them on the database track... That's lots more fun to watch. I was thinking about throwing in a few comments about the advantages of using Excel as a database manager to avoid all those problems that people have with constraints and datatypes.
-PatP|||Why, Excel is a great database application. You don't have to worry about a lot of indexes and constraints and crap, which makes it much more flexible for enterprise application development than a rigid system like SQL Server.
Plus, it's got pivot tables that will do dynamic crosstabs. SQL Server can't even touch that!
;)|||Yeah, with those kind of obvious benefits, how can you go wrong?
-PatP|||Diamonds, drugs, sex, and flowers for the most part. Delft does gorgeous porcelin.-PatP
Fox News told you Americans also recently about massive killings of babies in clinics, and you forgot the clogs and cheese.|||Hey, I may be American, but I DON'T watch Fox News!
I rode my bike through the Netherlands about 20 years ago. I remember you also have a lot of wind. A LOT of wind, and it was all headwind.|||Fox News told you Americans also recently about massive killings of babies in clinics, and you forgot the clogs and cheese.Yeah, but who doesn't like killing babies?
Don't the clogs and cheese just kind of grow there, like mushrooms and bicycles?
Actually, I have some really interesting memories of a bar called "The Three Flies" in Amsterdam. Someday I need to go back to see if it is still there!
-PatP
do I need Indexed Views for Replication
Howdy all. Ive been trying to avoid using Indexed Views
for Replication in my scenario because Im not totally
faliliar with the whole schemabinding deal. Plus I like
the convenience of sp_repladdcolumn. I was going to use
Custom Sync Objects instead but I think they may not work
for me. As you've all read in my previous posts, my
Subscriber has a different schema than my publisher. But I
just realized its different in ways I didnt see and now I
think Indexed Views are my only way to go.
I currently have a reporting server that at night has dts
packages that truncate the tables and repopulate from
production. But what I just realized is that some of the
destination tables are actually made up from two or more
source tables.
Source tables:
create table table1 (c1 int primary key,c2 varchar(10))
create table table2 (c1 int,c2 varchar(10))
Destination table:
create table bla(c1 int,c2 varchar(10),c3 varchar(10))
Example insert from nightly DTS package:
insert into bla(c1, c2, c3)
select t1.c1,t1.c2,t2.c2
from table1 t1
inner join table2 t2 on t1.c1 = t2.c1
So as you see, the destination is made up from two source
tables. I wrote a view for the initial population and the
data bcp'd successfully. But when I tried to insert a row
I had problems because of column c3. It makes sense that I
would need an Indexed View for this scenario because using
Custom Sync Objects the data is still coming from the
table, not a view. And since the Publisher doesnt have
column c3, it would seem a view would be needed. However,
before I flip flop back to and Indexed View, I would like
to see what you pros think.
TIA, ChrisR
is it possible to convert the DTS package to a publication and replicate
from the DTS source server to what is currenly your publisher and also to
your subscriber?
What are your requirements? It looks like data changes at discrete intervals
and then is static until the next package is run. Replication is the
replication of transactions or deltas (merge). If you have no real time
requirements DTS might be the best solution end to end. Either that or
perhaps snapshot replication.
Secondly I take it you are making a mistake in the schema.
I hope you mean this
create table table1 (c1 int primary key,c2 varchar(10))
create table table2 (c1 int,c3 varchar(10))
Destination table:
create table bla(c1 int,c2 varchar(10),c3 varchar(10))
Instead of this
> create table table1 (c1 int primary key,c2 varchar(10))
> create table table2 (c1 int,c2 varchar(10))
> Destination table:
> create table bla(c1 int,c2 varchar(10),c3 varchar(10))
As you can see there is no c3. Again we are going to need complete schemas
to address this, and tell us exactly what you are trying to do, and give the
exact requirements.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"ChrisR" <anonymous@.discussions.microsoft.com> wrote in message
news:03da01c49796$8bcb46a0$a301280a@.phx.gbl...
> sql2k sp3
> Howdy all. Ive been trying to avoid using Indexed Views
> for Replication in my scenario because Im not totally
> faliliar with the whole schemabinding deal. Plus I like
> the convenience of sp_repladdcolumn. I was going to use
> Custom Sync Objects instead but I think they may not work
> for me. As you've all read in my previous posts, my
> Subscriber has a different schema than my publisher. But I
> just realized its different in ways I didnt see and now I
> think Indexed Views are my only way to go.
> I currently have a reporting server that at night has dts
> packages that truncate the tables and repopulate from
> production. But what I just realized is that some of the
> destination tables are actually made up from two or more
> source tables.
> Source tables:
> create table table1 (c1 int primary key,c2 varchar(10))
> create table table2 (c1 int,c2 varchar(10))
> Destination table:
> create table bla(c1 int,c2 varchar(10),c3 varchar(10))
>
> Example insert from nightly DTS package:
> insert into bla(c1, c2, c3)
> select t1.c1,t1.c2,t2.c2
> from table1 t1
> inner join table2 t2 on t1.c1 = t2.c1
>
> So as you see, the destination is made up from two source
> tables. I wrote a view for the initial population and the
> data bcp'd successfully. But when I tried to insert a row
> I had problems because of column c3. It makes sense that I
> would need an Indexed View for this scenario because using
> Custom Sync Objects the data is still coming from the
> table, not a view. And since the Publisher doesnt have
> column c3, it would seem a view would be needed. However,
> before I flip flop back to and Indexed View, I would like
> to see what you pros think.
>
> TIA, ChrisR
>
>
|||> What are your requirements? It looks like data changes at discrete
intervals
> and then is static until the next package is run.
Those have been the requirements. Now I need it done continuosly.
> Secondly I take it you are making a mistake in the schema.
Yes. You are correct.
I'll have to post back everything later. Based on what you're seeing, have
you ever had a setup like this without Indexed Views? I dont think it can be
done, but know that you have lots more experience.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:uvySyK$lEHA.2020@.TK2MSFTNGP09.phx.gbl...
> is it possible to convert the DTS package to a publication and replicate
> from the DTS source server to what is currenly your publisher and also to
> your subscriber?
> What are your requirements? It looks like data changes at discrete
intervals
> and then is static until the next package is run. Replication is the
> replication of transactions or deltas (merge). If you have no real time
> requirements DTS might be the best solution end to end. Either that or
> perhaps snapshot replication.
> Secondly I take it you are making a mistake in the schema.
> I hope you mean this
> create table table1 (c1 int primary key,c2 varchar(10))
> create table table2 (c1 int,c3 varchar(10))
> Destination table:
> create table bla(c1 int,c2 varchar(10),c3 varchar(10))
> Instead of this
>
> As you can see there is no c3. Again we are going to need complete schemas
> to address this, and tell us exactly what you are trying to do, and give
the
> exact requirements.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> "ChrisR" <anonymous@.discussions.microsoft.com> wrote in message
> news:03da01c49796$8bcb46a0$a301280a@.phx.gbl...
>
|||I'm still kind of confused.
It sounds like there are 3 servers, server 1, server 2, and server 3.
Currently a DTS package reads table 1 and table 2 on server 1, and sends
data to server 2 to a table called table 3. Then server 2 publishes table 3
to server 3 to a table called table 4.
All of these tables are different.
Does this describe your situation.
I'd replicate from table 1 & 2 to server 2 table 3, and have a second
publication on server 1 replicating to table 4 on server 3. Replicating two
tables to 1 is a little more complex as you need to figure out which table
will generate a complete row.
It if table 1 contributes column a, b, c, and table 2 contributes column d,
you need the log reader to wirte a command to the distribution database when
there will be a complete set of columns for the row, and there has to be
some relationship between table 1 and table 2. Normally there is an
intersection table or join table and key off this table as a row in the join
table means that there is a row in table 1 and table 2. Then you also have
to replicate table 1 and table 2 as well, so that you have all the columns
for table 3 on the subscriber. The store procedure has to read tables 1 and
tables 2 to build table 3.
I normally use custom sync objects for this sort of stuff. Indexed views are
an option, but there is a space and performance penalty to pay (slight) for
using them, and they aren't resilient to schema changes.
As you have seen custom sync objects aren't problem free either, but they
seem to be an option in your case.
"ChrisR" <chris@.noemail.com> wrote in message
news:%23AsburDmEHA.2024@.TK2MSFTNGP10.phx.gbl...
> intervals
> Those have been the requirements. Now I need it done continuosly.
>
> Yes. You are correct.
> I'll have to post back everything later. Based on what you're seeing, have
> you ever had a setup like this without Indexed Views? I dont think it can
be[vbcol=seagreen]
> done, but know that you have lots more experience.
>
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:uvySyK$lEHA.2020@.TK2MSFTNGP09.phx.gbl...
to[vbcol=seagreen]
> intervals
schemas
> the
>
|||No. Two servers. Currently, a DTS Package runs nightly to populate one from
the other. I need to change that and start using replications because it
needs to be done continuosly. As you mentioned earlier:
Source table:
create table table1 (c1 int primary key,c2 varchar(10))
create table table2 (c1 int,c3 varchar(10))
Destination table:
create table bla(c1 int,c2 varchar(10),c3 varchar(10))
These tables cannot be changed. I was able to replicate this scenario using
Indexed Views, but not with Custom Sync Objects. Using CSO's I wab able to
BCP the snapshot with a view that matched the destination table, but the
insert and updates were causing problems because the source is two tables
and the destination is only one.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:u7FMWzEmEHA.592@.TK2MSFTNGP11.phx.gbl...
> I'm still kind of confused.
> It sounds like there are 3 servers, server 1, server 2, and server 3.
> Currently a DTS package reads table 1 and table 2 on server 1, and sends
> data to server 2 to a table called table 3. Then server 2 publishes table
3
> to server 3 to a table called table 4.
> All of these tables are different.
> Does this describe your situation.
> I'd replicate from table 1 & 2 to server 2 table 3, and have a second
> publication on server 1 replicating to table 4 on server 3. Replicating
two
> tables to 1 is a little more complex as you need to figure out which table
> will generate a complete row.
> It if table 1 contributes column a, b, c, and table 2 contributes column
d,
> you need the log reader to wirte a command to the distribution database
when
> there will be a complete set of columns for the row, and there has to be
> some relationship between table 1 and table 2. Normally there is an
> intersection table or join table and key off this table as a row in the
join
> table means that there is a row in table 1 and table 2. Then you also have
> to replicate table 1 and table 2 as well, so that you have all the columns
> for table 3 on the subscriber. The store procedure has to read tables 1
and
> tables 2 to build table 3.
> I normally use custom sync objects for this sort of stuff. Indexed views
are
> an option, but there is a space and performance penalty to pay (slight)
for[vbcol=seagreen]
> using them, and they aren't resilient to schema changes.
> As you have seen custom sync objects aren't problem free either, but they
> seem to be an option in your case.
>
> "ChrisR" <chris@.noemail.com> wrote in message
> news:%23AsburDmEHA.2024@.TK2MSFTNGP10.phx.gbl...
have[vbcol=seagreen]
can[vbcol=seagreen]
> be
replicate[vbcol=seagreen]
> to
time[vbcol=seagreen]
> schemas
give
>
|||Is there a one to one mapping of table 1 to table 2? Which is the parent and
which is the child?
"ChrisR" <chris@.noemail.com> wrote in message
news:uIQdpGFmEHA.1520@.TK2MSFTNGP10.phx.gbl...
> No. Two servers. Currently, a DTS Package runs nightly to populate one
from
> the other. I need to change that and start using replications because it
> needs to be done continuosly. As you mentioned earlier:
> Source table:
> create table table1 (c1 int primary key,c2 varchar(10))
> create table table2 (c1 int,c3 varchar(10))
> Destination table:
> create table bla(c1 int,c2 varchar(10),c3 varchar(10))
>
> These tables cannot be changed. I was able to replicate this scenario
using[vbcol=seagreen]
> Indexed Views, but not with Custom Sync Objects. Using CSO's I wab able to
> BCP the snapshot with a view that matched the destination table, but the
> insert and updates were causing problems because the source is two tables
> and the destination is only one.
>
>
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:u7FMWzEmEHA.592@.TK2MSFTNGP11.phx.gbl...
table[vbcol=seagreen]
> 3
> two
table[vbcol=seagreen]
> d,
> when
> join
have[vbcol=seagreen]
columns[vbcol=seagreen]
> and
> are
> for
they[vbcol=seagreen]
> have
> can
> replicate
also[vbcol=seagreen]
> time
or
> give
>
|||For this scenario yes, there is a one to one. Table1 being the parent.
However this is only one of my scenarios. I will also be dealing with some
one to many, and many to many. How does this affect the outcome out of
curiosity. FYI I wont be replicating the DRI. Also. I was just rereading
you're previous reply:
>It if table 1 contributes column a, b, c, and table 2 contributes column d,
>you need the log reader to wirte a command to the distribution database
when
>there will be a complete set of columns for the row, and there has to be
>some relationship between table 1 and table 2. Normally there is an
>intersection table or join table and key off this table as a row in the
join
>table means that there is a row in table 1 and table 2. Then you also have
>to replicate table 1 and table 2 as well, so that you have all the columns
>for table 3 on the subscriber. The store procedure has to read tables 1
and
>tables 2 to build table 3.
If Im reading this correctly, it looks like alot of work in place of Indexed
Views. I mean how hard is it to have the Log Reader write a command to the
Dist db when there's a complete set of columns for a row? Are there schema
change problems with Indexed Views other than not being able to use
sp_repladdcolumn?
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:epYGQ6FmEHA.596@.TK2MSFTNGP11.phx.gbl...
> Is there a one to one mapping of table 1 to table 2? Which is the parent
and[vbcol=seagreen]
> which is the child?
> "ChrisR" <chris@.noemail.com> wrote in message
> news:uIQdpGFmEHA.1520@.TK2MSFTNGP10.phx.gbl...
> from
> using
to[vbcol=seagreen]
tables[vbcol=seagreen]
sends[vbcol=seagreen]
> table
Replicating[vbcol=seagreen]
> table
column[vbcol=seagreen]
database[vbcol=seagreen]
be[vbcol=seagreen]
the[vbcol=seagreen]
> have
> columns
1[vbcol=seagreen]
ws[vbcol=seagreen]
(slight)[vbcol=seagreen]
> they
seeing,[vbcol=seagreen]
it[vbcol=seagreen]
> also
the[vbcol=seagreen]
that[vbcol=seagreen]
> or
and
>
|||I just re-read this once more:
Then you also have
> to replicate table 1 and table 2 as well, so that you have all the columns
> for table 3 on the subscriber.
If Im reading this correctly, it's one of the things I was afraid of. Are
you saying I need to have table1 and table2 on the Subscriber so I can
create table3? Im pretty sure you are, but wanted to make sure?
As always, thanks so much for all you're help.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:u7FMWzEmEHA.592@.TK2MSFTNGP11.phx.gbl...
> I'm still kind of confused.
> It sounds like there are 3 servers, server 1, server 2, and server 3.
> Currently a DTS package reads table 1 and table 2 on server 1, and sends
> data to server 2 to a table called table 3. Then server 2 publishes table
3
> to server 3 to a table called table 4.
> All of these tables are different.
> Does this describe your situation.
> I'd replicate from table 1 & 2 to server 2 table 3, and have a second
> publication on server 1 replicating to table 4 on server 3. Replicating
two
> tables to 1 is a little more complex as you need to figure out which table
> will generate a complete row.
> It if table 1 contributes column a, b, c, and table 2 contributes column
d,
> you need the log reader to wirte a command to the distribution database
when
> there will be a complete set of columns for the row, and there has to be
> some relationship between table 1 and table 2. Normally there is an
> intersection table or join table and key off this table as a row in the
join
> table means that there is a row in table 1 and table 2. Then you also have
> to replicate table 1 and table 2 as well, so that you have all the columns
> for table 3 on the subscriber. The store procedure has to read tables 1
and
> tables 2 to build table 3.
> I normally use custom sync objects for this sort of stuff. Indexed views
are
> an option, but there is a space and performance penalty to pay (slight)
for[vbcol=seagreen]
> using them, and they aren't resilient to schema changes.
> As you have seen custom sync objects aren't problem free either, but they
> seem to be an option in your case.
>
> "ChrisR" <chris@.noemail.com> wrote in message
> news:%23AsburDmEHA.2024@.TK2MSFTNGP10.phx.gbl...
have[vbcol=seagreen]
can[vbcol=seagreen]
> be
replicate[vbcol=seagreen]
> to
time[vbcol=seagreen]
> schemas
give
>
|||yes, you will need table 1 and table 2 to be replicated to the subscriber as
well.
Consider this, the log reader will extract all the columns in a table which
is being replicated and construct an insert/update/or delete statement only
consisting of columns from that table.
So if you replicate table 2 the commands written to the distribution agent
will be the pk and c3. Where will the distribution agent get the value for
c2 from?
It will have to join on table 1 in the subscriber to get this value. If its
not there it will never be able to plug it in.
You need to have the log reader key off table 2 when a complete record for
t3 exists which means that c1, c2 & c3 must be either in the proc or some of
these columns must be already on this table.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"ChrisR" <chris@.noemail.com> wrote in message
news:uD67QgJmEHA.3156@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> I just re-read this once more:
> Then you also have
columns[vbcol=seagreen]
> If Im reading this correctly, it's one of the things I was afraid of. Are
> you saying I need to have table1 and table2 on the Subscriber so I can
> create table3? Im pretty sure you are, but wanted to make sure?
> As always, thanks so much for all you're help.
>
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:u7FMWzEmEHA.592@.TK2MSFTNGP11.phx.gbl...
table[vbcol=seagreen]
> 3
> two
table[vbcol=seagreen]
> d,
> when
> join
have[vbcol=seagreen]
columns[vbcol=seagreen]
> and
> are
> for
they[vbcol=seagreen]
> have
> can
> replicate
also[vbcol=seagreen]
> time
or
> give
>
|||This is as I expected. Since this is a denormalized reporting server, I
think I will revert back to Indexed Views. To have both Table1 and Table2 on
the Subscriber so I can make up Table3 just doesnt make sense to me. It
almost seems to me as though its adding another layer of complexity. Can you
tell me if there are any schema change problems to watch out for with
Indexed Views besides the fact that I cant use sp_repladdcolumn? Any other
type of big gotchas that you can think of would be appreciated as well.
Also, whens the book coming out?
Thank you once more,
ChrisR
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:ekB3ztOmEHA.1376@.TK2MSFTNGP12.phx.gbl...
> yes, you will need table 1 and table 2 to be replicated to the subscriber
as
> well.
> Consider this, the log reader will extract all the columns in a table
which
> is being replicated and construct an insert/update/or delete statement
only
> consisting of columns from that table.
> So if you replicate table 2 the commands written to the distribution agent
> will be the pk and c3. Where will the distribution agent get the value for
> c2 from?
> It will have to join on table 1 in the subscriber to get this value. If
its
> not there it will never be able to plug it in.
> You need to have the log reader key off table 2 when a complete record for
> t3 exists which means that c1, c2 & c3 must be either in the proc or some
of[vbcol=seagreen]
> these columns must be already on this table.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> "ChrisR" <chris@.noemail.com> wrote in message
> news:uD67QgJmEHA.3156@.TK2MSFTNGP12.phx.gbl...
> columns
Are[vbcol=seagreen]
sends[vbcol=seagreen]
> table
Replicating[vbcol=seagreen]
> table
column[vbcol=seagreen]
database[vbcol=seagreen]
be[vbcol=seagreen]
the[vbcol=seagreen]
> have
> columns
1[vbcol=seagreen]
views[vbcol=seagreen]
(slight)[vbcol=seagreen]
> they
seeing,[vbcol=seagreen]
it[vbcol=seagreen]
> also
the[vbcol=seagreen]
that[vbcol=seagreen]
> or
and
>
Do I need a warehouse?
I have the following scenario and aren't sure of what approach I need to take to solve it. Any advice would be welcome (im very new to warehousing).
Scenario: I have a high transaction OLTP database (SQL Server) containing 20+ inter-related tables. It is all highly normalised. Over a year I am looking to accumulate something like 10+ million rows of information (most likely more).
The database is used extensively by an application (ASP.NET) which allows users to view (and in some cases update) the information in the database. The majority of the data is inserted by BizTalk.
Once an entire transaction is completed (which may take for example 2 weeks), it will not be changed in the future, but will still need to be reported on. I.e. View All Orders in March 07
Problem: As my data volumes grow, the performance of this database will undoubtedly begin to crawl, for both selects and inserts/updates. To solve this, I would like to move the completed transactions into an achieve (i.e. my datawarehouse) that will store the information in a denormalised state which the application can continue to use to perform queries (which I hope will be very fast).
I understand this isn't a typical use for a warehouse, namely I am not summing numerical figures or interesting in aggregating information based on measures/hierarchies.
Is what I want to do a correct approach, or can someone provide a better solution?
Any help would be greatly appreciated,
TM
Hello. You can build your data warehouse as highly normalized as you prefer. You can control the aggregation of information in one or several data marts that you can build from views or in tables in a new database.
Data warehouse and data marts(aggregated denormalized) informations do not have to be the same.
In the data warehouse you will normally remove some tables in order to keep the number of relations down to a minimum. You will also translate OLTP-columns to more business like names.
Still, if you build a copy of the source system in the data warehouse you will be able to remove historical transactions from the source. That will help performance in the source system.
Also, analytical queries will not compete for resources with transaction registration.
HTH
Thomas Ivarsson
|||
So Thomas,
If I were to build a denormalized warehouse could I then build a UDM cube on top of it without building an OALP fact/dimension type structure?
|||
Hello JohnSLG. Yes, I think you can. You can build cubes on top of OLTP-systems.
You can have all information like dimensions, hierarchies and measures in one table and build a cube on that.
Best practice, however, points to a data mart on top of a data warehouse.
Kind Regards
Thomas Ivarsson
|||
Thank you for your response, greatly appreciated.
Could you also point me to where I can get a grounding in general warehousing theory? Then build onto this with Analysis Serviecs.
Kind regards
TM
|||Here is a good link: www.kimballgroup.com
Regards
Thomas Ivarsson
Friday, February 24, 2012
Distribution Agent Startup Parameters
I have scenario where I use two servers: SQL 2K sp4, on Win2K3 sp1. One
server is a publisher, the other a subscriber. The replication topology is
Transaction Replication with 1 queued updating subscriber. The distribution
agent resides on the publisher.
Firstly, I am aware of nosync replication, but my environment requires some
more testing before I can implement it, because I can't take the publisher
offline, and I believe some tweaks are needed to ensure that the data will
truly be in sync. This said, one of my publications has a table article with
234 million records to transfer when the article is reinitialized. I am
having problems with the transaction log growing so large on the subscriber,
that it consumes all server space, and effectively kills the distribution
agent.
To mitigate this, I have tried to use the -BcpBatchSize parameter to try to
get the rows per batch down to manageable size so that I can manually shrink
the transaction log intermittantly while the distribution agent is applying
the snapshot. My strategy is not working.
Questions:
1) does -BcpBatchSize directly control the application of the snapshotted
article's transaction commit size, or is this parameter used outside of the
distribution agent's application of a snapshot?
2) does using -UseInprocLoader affect the -BcpBatchSize parameter? I ask
because bulk insert is different from bcp.
3) would -CommitBatchSize be a more appropriate setting to allow me to
actively manage the transaction log on the subscriber while this huge table
is being transferred?
Thanks for any input,
John T
If you are using concurrent snapshot on SQL2000, your only hope will be to
make sure that you hit the minimal logging code path when the snapshot is
delivered to the subscriber as the *entire* snapshot will be applied in an
atomic transaction. At the risk of telling you something that you may know
already, this means that you need to:
1) Make sure that 'select into\bulk copy' is enabled at the subscriber
database
2) The target table is empty with at most one index or not having any
indexes when the bulk copy occurs. This may be tricky to enforce as the
SQL2000 index creation logic in the distribution agent is not very precise.
You may want to modify the .idx scripts to leave only the primary key index
and then manually create other indexes afterwards.
3) Set -BcpBatchSize to be *larger* than the maximum number of rows in your
published tables. 2^31 - delta should work fine. Notice that you may start
seeing "Agent is waiting for database backend.." messages since the
distribution agent will not be able to log any progress messages until the
entire bulk load operation is done. You have also want to increase
the -QueryTimeout of the distribution agent.
-Raymond
"John T" <JohnT@.discussions.microsoft.com> wrote in message
news:469D5803-1C9E-447E-9513-2AE04EFEB305@.microsoft.com...
> Hello,
> I have scenario where I use two servers: SQL 2K sp4, on Win2K3 sp1. One
> server is a publisher, the other a subscriber. The replication topology
> is
> Transaction Replication with 1 queued updating subscriber. The
> distribution
> agent resides on the publisher.
> Firstly, I am aware of nosync replication, but my environment requires
> some
> more testing before I can implement it, because I can't take the publisher
> offline, and I believe some tweaks are needed to ensure that the data will
> truly be in sync. This said, one of my publications has a table article
> with
> 234 million records to transfer when the article is reinitialized. I am
> having problems with the transaction log growing so large on the
> subscriber,
> that it consumes all server space, and effectively kills the distribution
> agent.
> To mitigate this, I have tried to use the -BcpBatchSize parameter to try
> to
> get the rows per batch down to manageable size so that I can manually
> shrink
> the transaction log intermittantly while the distribution agent is
> applying
> the snapshot. My strategy is not working.
> Questions:
> 1) does -BcpBatchSize directly control the application of the snapshotted
> article's transaction commit size, or is this parameter used outside of
> the
> distribution agent's application of a snapshot?
> 2) does using -UseInprocLoader affect the -BcpBatchSize parameter? I ask
> because bulk insert is different from bcp.
> 3) would -CommitBatchSize be a more appropriate setting to allow me to
> actively manage the transaction log on the subscriber while this huge
> table
> is being transferred?
> Thanks for any input,
> John T
|||Hi Raymond, I though bcpBatchSize is analogous to the batchsize in bcp,
which means that it controls how many rows will be applied at a time in a
batch. Won't setting it to a large value create a very large transaction log
for large tables?
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
"Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
news:evddMLk8GHA.4084@.TK2MSFTNGP05.phx.gbl...
> If you are using concurrent snapshot on SQL2000, your only hope will be to
> make sure that you hit the minimal logging code path when the snapshot is
> delivered to the subscriber as the *entire* snapshot will be applied in an
> atomic transaction. At the risk of telling you something that you may know
> already, this means that you need to:
> 1) Make sure that 'select into\bulk copy' is enabled at the subscriber
> database
> 2) The target table is empty with at most one index or not having any
> indexes when the bulk copy occurs. This may be tricky to enforce as the
> SQL2000 index creation logic in the distribution agent is not very
> precise. You may want to modify the .idx scripts to leave only the primary
> key index and then manually create other indexes afterwards.
> 3) Set -BcpBatchSize to be *larger* than the maximum number of rows in
> your published tables. 2^31 - delta should work fine. Notice that you may
> start seeing "Agent is waiting for database backend.." messages since the
> distribution agent will not be able to log any progress messages until the
> entire bulk load operation is done. You have also want to increase
> the -QueryTimeout of the distribution agent.
> -Raymond
> "John T" <JohnT@.discussions.microsoft.com> wrote in message
> news:469D5803-1C9E-447E-9513-2AE04EFEB305@.microsoft.com...
>
|||Hilary, what you said is true, but the goal of my reccomendations is not to
have small transactions but to hit the minimal logging (or bulk-logged) code
path in the server which is the only feasible way to have a manageable log
size when a concurrent snapshot is applied in SQL2000. If a small batch size
is specified, the server will see the target table as non-empty after the
first batch is loaded and start going down the fully-logged code path after
that. And since there is an outer transaction bounding the delivery of a
concurrent snapshot in SQL2000, the log simply cannot be truncated even with
a small bcp batch size. I can understand why you think this is
counter-intuitive, but my suggestion had worked on a few occasions before
including the following:
http://groups.google.com/group/micro... e49f1fb79fe5
-Raymond
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:uuGAtgk8GHA.2316@.TK2MSFTNGP04.phx.gbl...
> Hi Raymond, I though bcpBatchSize is analogous to the batchsize in bcp,
> which means that it controls how many rows will be applied at a time in a
> batch. Won't setting it to a large value create a very large transaction
> log for large tables?
> --
> 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
> "Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
> news:evddMLk8GHA.4084@.TK2MSFTNGP05.phx.gbl...
>
|||Ok, got it! Thanks Raymond. Still waiting on that beer you owe me;)
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
news:Oy1jKJl8GHA.2120@.TK2MSFTNGP03.phx.gbl...
> Hilary, what you said is true, but the goal of my reccomendations is not
> to have small transactions but to hit the minimal logging (or bulk-logged)
> code path in the server which is the only feasible way to have a
> manageable log size when a concurrent snapshot is applied in SQL2000. If a
> small batch size is specified, the server will see the target table as
> non-empty after the first batch is loaded and start going down the
> fully-logged code path after that. And since there is an outer transaction
> bounding the delivery of a concurrent snapshot in SQL2000, the log simply
> cannot be truncated even with a small bcp batch size. I can understand why
> you think this is counter-intuitive, but my suggestion had worked on a few
> occasions before including the following:
> http://groups.google.com/group/micro... e49f1fb79fe5
> -Raymond
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:uuGAtgk8GHA.2316@.TK2MSFTNGP04.phx.gbl...
>
|||Raymond,
Just a couple of points of clarification:
1) If I am using simple recovery mode, I should get the same benefits in
this case as using bulk recovery mode, correct?
2) If I choose the schema option to drop the tables before the snapshot is
applied, this should meet all of the requirements in your second point,
correct?
3) Regarding the -BcpBatchSize setting of 2^31 - delta, what is the delta,
my desired batch commit size?
Thanks
John T
"Raymond Mak [MSFT]" wrote:
> If you are using concurrent snapshot on SQL2000, your only hope will be to
> make sure that you hit the minimal logging code path when the snapshot is
> delivered to the subscriber as the *entire* snapshot will be applied in an
> atomic transaction. At the risk of telling you something that you may know
> already, this means that you need to:
> 1) Make sure that 'select into\bulk copy' is enabled at the subscriber
> database
> 2) The target table is empty with at most one index or not having any
> indexes when the bulk copy occurs. This may be tricky to enforce as the
> SQL2000 index creation logic in the distribution agent is not very precise.
> You may want to modify the .idx scripts to leave only the primary key index
> and then manually create other indexes afterwards.
> 3) Set -BcpBatchSize to be *larger* than the maximum number of rows in your
> published tables. 2^31 - delta should work fine. Notice that you may start
> seeing "Agent is waiting for database backend.." messages since the
> distribution agent will not be able to log any progress messages until the
> entire bulk load operation is done. You have also want to increase
> the -QueryTimeout of the distribution agent.
> -Raymond
> "John T" <JohnT@.discussions.microsoft.com> wrote in message
> news:469D5803-1C9E-447E-9513-2AE04EFEB305@.microsoft.com...
>
>
|||Hi John,
In response to your inquiry:
1) Simple recovery mode is fine.
2) You may still need to make sure that only the primary key index got
created since the index creation logic in SQL2000 distribution agent is not
as optimal as it can be.
3) Delta is just a small number, you only need to make sure that the
resulting bcpbatchsize is bigger than the maximum number of rows in any of
your tables
Hope that helps,
-Raymond
"John T" <JohnT@.discussions.microsoft.com> wrote in message
news:A677C2FE-F672-4473-9B2E-725AFE500039@.microsoft.com...[vbcol=seagreen]
> Raymond,
> Just a couple of points of clarification:
> 1) If I am using simple recovery mode, I should get the same benefits in
> this case as using bulk recovery mode, correct?
> 2) If I choose the schema option to drop the tables before the snapshot is
> applied, this should meet all of the requirements in your second point,
> correct?
> 3) Regarding the -BcpBatchSize setting of 2^31 - delta, what is the delta,
> my desired batch commit size?
> Thanks
> John T
> "Raymond Mak [MSFT]" wrote:
|||Wait a minute, I think you are the one who owe me a beer, and I have proof
for that...
http://groups.google.com/group/micro... c299fb7328e2d
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%23yI5FQr8GHA.3820@.TK2MSFTNGP02.phx.gbl...
> Ok, got it! Thanks Raymond. Still waiting on that beer you owe me;)
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> 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
>
> "Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
> news:Oy1jKJl8GHA.2120@.TK2MSFTNGP03.phx.gbl...
>
|||freaking Google.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
news:enfPtCt8GHA.1492@.TK2MSFTNGP02.phx.gbl...
> Wait a minute, I think you are the one who owe me a beer, and I have proof
> for that...
> http://groups.google.com/group/micro... c299fb7328e2d
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:%23yI5FQr8GHA.3820@.TK2MSFTNGP02.phx.gbl...
>
|||This suggestion worked excellently. I went from filling up over 275 gigs of
drive space trying to deploy these large tables, to only using 975 megs of
drive space.
Thank you,
John T
"Raymond Mak [MSFT]" wrote:
> Hi John,
> In response to your inquiry:
> 1) Simple recovery mode is fine.
> 2) You may still need to make sure that only the primary key index got
> created since the index creation logic in SQL2000 distribution agent is not
> as optimal as it can be.
> 3) Delta is just a small number, you only need to make sure that the
> resulting bcpbatchsize is bigger than the maximum number of rows in any of
> your tables
> Hope that helps,
> -Raymond
> "John T" <JohnT@.discussions.microsoft.com> wrote in message
> news:A677C2FE-F672-4473-9B2E-725AFE500039@.microsoft.com...
>
>
Tuesday, February 14, 2012
Distributed Scenario...
We're building a windows app and using SQL 2005.
The scenario is this.
Our app will be spread across various geographical locations.
The information is more or less location specific i.e. a user in one
loaction will probably not require to see/modify the data in another
location. We are looking at huge volumes of data and the connectivity
could be pretty decent.
Do we
1. Go with one centralised server?
2. Go with a server for each location.
In this scenario what would be the impact on the cost.
3. Go with Point 2 but also have one centralised server which will sink
up data from all locations. Is this suggested? If so does SQL server
have some kind of automatic sync utility or services which can be say
run at a particular time?
4. I do not have much info on Mirroring but will this help if I were to
use a centralised server.?
Thanks in advance
Soni
I cant be certain without having some more info regarding size and req for
your scenario. I would probably use option 3 and yes, you can maintain
centralised server through replication or SSIS or some other feature
depending on your needs.
As for the 4) Mirroring will not be available untill mid 2006 and it could
help, again depending on what would you want to do on the centralised
server...
MC
"hangar18" <soni.somarajan@.wipro.com> wrote in message
news:1133250860.462491.247260@.f14g2000cwb.googlegr oups.com...
> Hi ,
> We're building a windows app and using SQL 2005.
> The scenario is this.
> Our app will be spread across various geographical locations.
> The information is more or less location specific i.e. a user in one
> loaction will probably not require to see/modify the data in another
> location. We are looking at huge volumes of data and the connectivity
> could be pretty decent.
> Do we
> 1. Go with one centralised server?
> 2. Go with a server for each location.
> In this scenario what would be the impact on the cost.
> 3. Go with Point 2 but also have one centralised server which will sink
> up data from all locations. Is this suggested? If so does SQL server
> have some kind of automatic sync utility or services which can be say
> run at a particular time?
> 4. I do not have much info on Mirroring but will this help if I were to
> use a centralised server.?
> Thanks in advance
> Soni
>
Distributed Scenario...
We're building a windows app and using SQL 2005.
The scenario is this.
Our app will be spread across various geographical locations.
The information is more or less location specific i.e. a user in one
loaction will probably not require to see/modify the data in another
location. We are looking at huge volumes of data and the connectivity
could be pretty decent.
Do we
1. Go with one centralised server?
2. Go with a server for each location.
In this scenario what would be the impact on the cost.
3. Go with Point 2 but also have one centralised server which will sink
up data from all locations. Is this suggested? If so does SQL server
have some kind of automatic sync utility or services which can be say
run at a particular time?
4. I do not have much info on Mirroring but will this help if I were to
use a centralised server.?
Thanks in advance
SoniI cant be certain without having some more info regarding size and req for
your scenario. I would probably use option 3 and yes, you can maintain
centralised server through replication or SSIS or some other feature
depending on your needs.
As for the 4) Mirroring will not be available untill mid 2006 and it could
help, again depending on what would you want to do on the centralised
server...
MC
"hangar18" <soni.somarajan@.wipro.com> wrote in message
news:1133250860.462491.247260@.f14g2000cwb.googlegroups.com...
> Hi ,
> We're building a windows app and using SQL 2005.
> The scenario is this.
> Our app will be spread across various geographical locations.
> The information is more or less location specific i.e. a user in one
> loaction will probably not require to see/modify the data in another
> location. We are looking at huge volumes of data and the connectivity
> could be pretty decent.
> Do we
> 1. Go with one centralised server?
> 2. Go with a server for each location.
> In this scenario what would be the impact on the cost.
> 3. Go with Point 2 but also have one centralised server which will sink
> up data from all locations. Is this suggested? If so does SQL server
> have some kind of automatic sync utility or services which can be say
> run at a particular time?
> 4. I do not have much info on Mirroring but will this help if I were to
> use a centralised server.?
> Thanks in advance
> Soni
>
Distributed Scenario...
We're building a windows app and using SQL 2005.
The scenario is this.
Our app will be spread across various geographical locations.
The information is more or less location specific i.e. a user in one
loaction will probably not require to see/modify the data in another
location. We are looking at huge volumes of data and the connectivity
could be pretty decent.
Do we
1. Go with one centralised server?
2. Go with a server for each location.
In this scenario what would be the impact on the cost.
3. Go with Point 2 but also have one centralised server which will sink
up data from all locations. Is this suggested? If so does SQL server
have some kind of automatic sync utility or services which can be say
run at a particular time?
4. I do not have much info on Mirroring but will this help if I were to
use a centralised server.?
Thanks in advance
SoniI cant be certain without having some more info regarding size and req for
your scenario. I would probably use option 3 and yes, you can maintain
centralised server through replication or SSIS or some other feature
depending on your needs.
As for the 4) Mirroring will not be available untill mid 2006 and it could
help, again depending on what would you want to do on the centralised
server...
MC
"hangar18" <soni.somarajan@.wipro.com> wrote in message
news:1133250860.462491.247260@.f14g2000cwb.googlegroups.com...
> Hi ,
> We're building a windows app and using SQL 2005.
> The scenario is this.
> Our app will be spread across various geographical locations.
> The information is more or less location specific i.e. a user in one
> loaction will probably not require to see/modify the data in another
> location. We are looking at huge volumes of data and the connectivity
> could be pretty decent.
> Do we
> 1. Go with one centralised server?
> 2. Go with a server for each location.
> In this scenario what would be the impact on the cost.
> 3. Go with Point 2 but also have one centralised server which will sink
> up data from all locations. Is this suggested? If so does SQL server
> have some kind of automatic sync utility or services which can be say
> run at a particular time?
> 4. I do not have much info on Mirroring but will this help if I were to
> use a centralised server.?
> Thanks in advance
> Soni
>