|
Hampden Tech wrote: there is also an instance of SQL-2000 running and that must have been using port 1433
Dynamic ports is fine. If you have another SQL Server (the older one) in port 1433, you should open 1434 (or some other port) for tcp traffic for this SQL Server (I recall you opened udp). Also make sure that the newer SQL Server is listening on 1434. When changing the network protocols, prefer using SQL Server configuration manager in SQL Server 2005.
Hampden Tech wrote: Thanks for the reply Mike
You're welcome.
|
|
|
|
|
I have an application that uses SQL Server 2005 Express at site A.
I now have users that would like to have access to this application from site B.
At site B I have a server that also has SQL Server 2005 Express.
I would like to explore the use of SQL replication technology to see if that would work for when a user connects to the database, it will pull from its respective local DB. These sites are currently connected to each other through an IPSEC tunnel through our WAN link.
Does SQL Server 2005 support Database replication?
Is it relatively easy to setup?
Can someone point me in the general direction of where I can get some step-by-step directions?
Thank you all very much,
Joey
modified on Friday, January 23, 2009 7:04 PM
|
|
|
|
|
SQL Server supports replication and one-way replication is quite easy to set up. Two-way replication (merge) is much more complex (this is true for all databases).
You can read basics for replication for example here: SQL Server Replication[^]
However since you're using Express edition in all nodes, it won't be possible to setup full replication. Express Edition can only be a subscriber in replication scenarios so you would need a standard version in your setup in order to create a publisher.
For more info about different features in different editions, see: Features Supported by the Editions of SQL Server 2005[^]
|
|
|
|
|
I understand. In order to get full replication I have to have at least one publishing point (which has to come from at a minimum, a standarad version of SQL) and I also have to have one subscriber. Would the DB replicate on a specfic timed interval or when it detects that there has been changes? Thank you,
Joey
|
|
|
|
|
In short: on a specfic timed interval. Replication uses SQL Server Agent jobs which are executed on an interval (configurable).
|
|
|
|
|
Mike, in your opinion, what type of bandwidth would we require for this type of replication to happen smoothly? The sites are linked together through an IPSec tunnel, however we are using a Cable Modem at one end (~3-5MBps down and no more than ~1MBps up) and the other end is 2 bonded T1 connections. I'm assuming that the replication will really only replicate the necessary changes, I'm just a little concerned about it becoming a bandwidth suck.
Thanks,
Joey
|
|
|
|
|
Sounds like you need transactional replication. That replication works so that first a snapshot is taken from the source to get the current situation for the publication. This is delivered to subscriber(s). After that modifications to publication are gathered at the source and they are delivered to subscribers at configurable intervals.
Just a warning. This works fine when the transfer is only from source to target. If it's bi-directional so that the same data can be modified on all nodes, you will easily get into trouble because of update conflicts.
Finally to your question. The bandwith depends at least on these things:
- replication interval, the smaller the interval is, the less modifications need to be transferred
- amount of changes, how much data is changed (inserted, updated and deleted) at the source between two transfers
- characteristics of the changed data, if it is mainly numbers or dates, it requires less bandwith than for example longer varchar data not to mention BLOB data
- reliability of the connection, if the data must be sent several times, it will affect. Also it affects if the data is buffered on distributor because connection isn't available.
So as you see, it's quite impossible to give any accurate bandwith, but I believe that if you investigate those things, you'll get a clear picture on the data amounts.
Also why not build a test replication environment, replicate the actual data and use replication monitor in SQL Server and performance monitor to see what kind of amounts are transferred.
BTW, I noticed that you're new to CodeProject, welcome! Just to inform you that we have a voting system you can use if you want. Each reply can be marked good/bad and if the type of the post isn't reply, you'll see voting options in the lower right corner of the post from 1 (bad) to 5 (good). Usually these are used to indicate if the answers given to a person were helpful or not.
Mika
|
|
|
|
|
hello,
i have to ask for a sql query:
scenerio:
i have two tables CHATROOMS AND MEMBERS
CHATROOMS table contain columns (ROOM_ID(pk) and ROOM_NAME)
MEMBERS table contain columns (MEMBER_ID, ROOM_ID(fk))
now i have a gridview control in which i have to display all ROOM_IDs along with members init.
like:
ROOM_ID | MEMBERS
room1 | 5
room2 | 7
room3 | 6
room5 | 2
i want a single query for it coz i am binding data to gridview using SQLDATASOURCE control in ASP.net(C#)
the query i am trying is not working!
my query is:
select count(*) as total from MEMBERS where ROOM_ID = (select ROOM_ID from CHATROOMS)
the error on this query is logical that the inner query is returning multiple rows on which the outer WHERE is bound
please help me out i am struct in btw my project....
thanks,
tc
regards,
Sana
$@N@
|
|
|
|
|
Perhaps be something like:
select c.room_id, count(*)
from chatrooms c
inner join members m
on cm.room_id = c.room_id
group by c.room_id
|
|
|
|
|
Thanksalot!!!
my problem is solved now..
Allah bless youuu!
tc
regards,
Sana
$@N@
|
|
|
|
|
You're welcome
|
|
|
|
|
I have populated a dataset with a dataadapter and now I want to change the values. Nothing happens.
All rows are selected
Dim tblADR_BASE As DataTable
tblADR_BASE = dsADR_BASE.Tables("ADR_BASE")
Dim rows() As DataRow = tblADR_BASE.Select()
Dim intCRNO As Integer
Dim i As Integer
For i = 0 To rows.GetUpperBound(0)
intCRNO = checkForCRNO(rows(i))
rows(i)("dsp_CRNO") = intCRNO
rows(i)("CITY_ID") = "test"
Console.WriteLine(rows(i)("dsp_CRNO"))
dsADR_BASE.AcceptChanges()
Next i
Whats weird is I can wright the supposed changes to the console, but if I actually open the table in the dataset, nothing has been changed.
Am I missing some sort of save?
Thanks
|
|
|
|
|
With a quick look the code looks fine (although you don't have to call AcceptChanges on every iteration). What does the code look like where you investigate if data is changed.
|
|
|
|
|
Thanks Mike,
Dim test = dsADR_BASE.HasChanges
Produces false.
I swear I had this working a week ago on a different table. I have since added fields to this table and think maybe that screwed things up. I have refreshed everything.
|
|
|
|
|
It's because you call AcceptChanges in the loop. That method clears the modified flag from all rows. The idea behind AcceptChanges is that you let the rows to be modified (or inserted or updated) until you put the data to a safe place (for example database). After that the modification flags can be removed.
So in short, remove the AcceptChanges.
|
|
|
|
|
Thanks, I'll give that a try.
But, I added the AcceptChanges after I ran into the issue. But I will sure give it a go.
Thing is, the tables are being restored at the moment, and I have to stay out of it. I'll post results when I can. May be Monday.
Thanks
|
|
|
|
|
enipla wrote: But, I added the AcceptChanges after I ran into the issue
If that's the case, check that you don't have acceptChanges (or RejectChanges) anywhere else. When you can you can do the same HasChanges test using debugger after the loop. That way you can confirm that the dataset has been modified by your loop.
|
|
|
|
|
New DB, Same result. I got rid of the only AcceptChanges. There are no RejectChanges.
It still writes to the console
|
|
|
|
|
After the loop, did you test with the debugger, what's the value of dsADR_BASE.HasChanges
modified on Friday, January 23, 2009 4:38 PM
|
|
|
|
|
We are getting somewhere. .HasChanges = true.
When I open the table with the preview data option no data has been changed.
|
|
|
|
|
If you take a look at the row after you have modified it's values, do you see the change in the data and is the RowState Modified
|
|
|
|
|
row.RowState = Modified
And I can print the values out to the console AFTER I leave the loop.
I just don't see the changes when I open the table under the DataSouces Tab.
Thanks again Mike. I'll be leaving work in about a 1/2 hour if I don't get back to you today.
|
|
|
|
|
Okay. When you have the opportunity, check that you update the data somewhere in you code using SqlDataAdapter.Update and that you don't call Fill before that. That should make the modifications to the original data source.
|
|
|
|
|
That did it.
I was sure that I was looking at a DataSet, and that you don't have to update the source to see the changes in the set.
I must not be looking in the correct place. I'm in the DataSources Tab, and it only shows the Tables that I want in the dataset. I assumed I was looking at the DataSet, but I guess that's the DataSource.
Thanks Mike. You did it again for me.
|
|
|
|
|
No problem at all
|
|
|
|