Answered by:
What is the SQL query for Upload Inserts?

Question
-
I used a wizard to create my Sync from a local CE database to a SQL 2000 database. This is the command that was generated to Insert records into the SQL 2000 database from the local CE database:
this.InsertCommand.CommandText = @"INSERT INTO dbo.EventsToGo ([EventUID], [EventID], [DealerID], [Event], [EventCompleteYN], [DateDue], [DateCompleted], [UserCompleted], [Decision], [Comment], [DateEdited], [UserEdited], [Minutes], [CreatedBy], [CreationDate], [ContactUID], [SalesRep]) VALUES (@EventUID, @EventID, @DealerID, @Event, @EventCompleteYN, @DateDue, @DateCompleted, @UserCompleted, @Decision, @Comment, @DateEdited, @UserEdited, @Minutes, @CreatedBy, @CreationDate, @ContactUID, @SalesRep) SET @sync_row_count = @@rowcount";
What I don't understand is how the inserted records are selected, since the SQL doesn't have a "WHERE" clause. The other SQL statements (Update, Delete) have WHERE clauses that help me understand how the records are chosen, but not the Insert command.
How can I view the SQL statement and potentially modify the selection of records that will be inserted?
Thanks,
Reese
Wednesday, March 31, 2010 7:18 PM
Answers
-
JuneT,
Thanks for the response. The "...Incremental" commands are the commands for applying server changes to the client data. I'm interested in the commands that apply client changes to the server.
I did find the answer by using the Trace functions of the Sync Framework. If anyone else is curious, you can find the directions for that here:
http://msdn.microsoft.com/en-us/library/cc807160(v=SQL.105).aspx
The trace functions allow you to see the details of the commands that are being created.
Reese
- Marked as answer by reswat Monday, April 5, 2010 12:16 PM
Monday, April 5, 2010 12:16 PM
All replies
-
you should find a separate command prefixed SelectIncremental. There will be one for Insert, another for Update and another for Delete. The commands are separate for selecting changes and applying changes.Wednesday, March 31, 2010 7:24 PM
-
JuneT,
Thanks for the response. The "...Incremental" commands are the commands for applying server changes to the client data. I'm interested in the commands that apply client changes to the server.
I did find the answer by using the Trace functions of the Sync Framework. If anyone else is curious, you can find the directions for that here:
http://msdn.microsoft.com/en-us/library/cc807160(v=SQL.105).aspx
The trace functions allow you to see the details of the commands that are being created.
Reese
- Marked as answer by reswat Monday, April 5, 2010 12:16 PM
Monday, April 5, 2010 12:16 PM -
if you used the designer to generate the code, the SQL statements will be under InitializeCommands().
The SelectIncrementalInsertsCommand, SelectIncrementalUpdatesCommand and SelectIncrementalDeletesCommand are used to select the changes to be applied.
The InsertCommand, DeleteCommand and UpdateCommand are used to apply the changes.
Monday, April 5, 2010 2:45 PM -
June,
There are two sets of updates to be made:
1) Updates to the client from the server
2) Updates to the server from the client
The SelectIncremental... apply only to item (1) above., which can be confirmed at this link:
Reese
Monday, April 5, 2010 4:51 PM -
June,
There are two sets of updates to be made:
1) Updates to the client from the server
2) Updates to the server from the client
The SelectIncremental... apply only to item (1) above., which can be confirmed at this link:
Reese
Monday, April 5, 2010 4:52 PM