Hi Everyone:
I am new to Mobile programming. I am now working on a mobile project. I encounter an issue when I sync the data:
cause I can't modify the schema, so I have to use RDA instead of Merge replication on sql server 2005.
However, There is an identiy column on each table I will pull them down to local mobile database. And I will use those identity columns to connect tables. Even worse, the photo's new name will combine the photoID which is an identity column. There would an issue, if i sync data, the photoID would be same on different local mobile databases. And there would be generate same identity value when users sync data.
How can I avoid those issues? If you have any good ideas, please help me out so that I can meet the project deadline.
Thanks
James
Anyone knows how to manually handle identity management.
Cause my identity column will clash when Sync data.
James
|||You need to call
ALTER TABLE <TableName> ALTER COLUMN <ColumnName> <ColumnDataType> IDENTITY(<Seed>,<Step>)
to set the different identity on the pulled table.
Note, only Seed and Step can be changed in the above table.
Thanks,
Laxmi Narsimha Rao ORUGANTI
|||Hi Laxmi,
Thank you for your reply. I realize that I can use the command you gave to change the SEED range to avoid the clash. But if I change seed, when I push the data back to Remote SQL server 2005 database, should I disable the identity column on remote database, then push mobile client table data, then set identity column back on remote DB. It seems lots of work to manually handle identity column clash. Do we have any alternative way to do it, since I can't use merge replication to change the database schema, what about XML web service? I think should be same, but if we use Web Service, the performance should be down 10-15%, that's why i don't wanna use it since we choose SQL server 2005 as our database.
Your reply is really appreciated. Thanks!
James
|||I need to point is that someone will work on remote db through classical ASP. If I change the identity Seed. It will effect mobile client?
If anybody has the same issues?
Thanks
James
|||No need to worry about disabling the IDENTITY on server. RDA while pushing automatically does "SET IDENTITY_INSERT <TableName> ON/OFF" on SQL Server to get the same IDENTITY column values onto the server table.
Thanks,
Laxmi
|||Thank Laxmi,
your reply does help me. I will try it out. But we have 200 hundred of Mobile clients. We have to set the identity range for each one.
Any other good ideas for solving the identity clash.
Thanks.
James
|||That is why there is Merge Replication! Why not go for that?|||Because I can't modify the Sql server 2005 DB schema. They are using identity ID. I wish I could use Merge replication. I can save my code lines as well.
Thank you . Laxmi. You are the rock!
James
|||Same here, merge replication is not a option.Anyone found a suitable solution for this challenge?
Thanx
|||What I have done is to set the ID range for each person. So that they won't clash.
No comments:
Post a Comment