Hi,
I have 3 problems regarding SQL Server 2005...
1) I would like to create a SQL Server 2005 database with a T-SQL
Query.
I have found an example in the MSDN library to create a SQLMobile
database:
CREATE DATABASE SQLMobile
GO
USE SQLMobile
GO
CREATE TABLE MembershipData (MemberID INTEGER IDENTITY (1,1) PRIMARY
KEY, MemberName NVarChar (50))
CREATE TABLE FlightData (MemberID INTEGER FOREIGN KEY REFERENCES
MembershipData(MemberID), Destination NVarChar (50), FlightStatus
NVarChar(50), ArrivalDate DATETIME, FlownMiles INTEGER)
If I wanted to set a predefined value for every field of the the
MembershipData and FlightData tables, how should I modify the 2
statements? What should I add?
2) When I create a publication of this SQLMobile and I select the 2
tables as articles to publish, will be published the relationship too?
(between the MemberID field of MembershipData and the MemberID of
FlightData)? If not, is there a way to do it?
3) Suppose that now I have a SQLMobile database (of SQL Server type) in
my PC, and a SQLMobile one (of SQL Server Mobile type, synchronized
with merge replication to the PC's one) in a pocket PC.
Suppose that I delete the MembershipData record with MemberID = 1 in
the PC database (MembershipData is the parent table) and that, after 1
hour, I add a FlightData record with MemberID = 1 in the pocket PC (I
can do it because the MembershipData record with MemberID = 1 exists
yet in the PPC).
When I synchronize the 2 database, what happens?
Is a PC database MembershipData record with MemberID = 1 re-created
(and created the FlightData record with MemberID = 1 too), or is the
PPC database MembershipData record with MemberID = 1 deleted?
4) If I exchange the temporal sequence of the 2 operations, and first I
add the PPC database FlightData record with MemberID = 1, and after 1
hour I delete the PC database MembershipData record with MemberID = 1
(and finally I synchronize), does something change respect to the
previous situation?
Thank you very much