Showing posts with label tracking. Show all posts
Showing posts with label tracking. Show all posts

Wednesday, March 7, 2012

RDA tracking - no primary key on table

Hello,

Can a table be tracked if it does not have a primary key? I am using rda.Pull method in VS2005 using C#. If not, what are my options? Any help is appreciated.

Thanks.

A primary is required if using RDA tracking. See http://msdn2.microsoft.com/en-us/library/ms172971.aspx

"A primary key must be defined on the updatable recordset returned by the SELECT statement. "

Saturday, February 25, 2012

RDA pull - from a temporary table

Hi

I am doing a RDA Pull with tracking off, getting the data via a stored procedure.

Ideally I want the proc to return the data from a temporary table, so I can do some fancy formatting of the data before we pull it down to the PDA. It's not updateable, so with tracking off, I would have thought this would be possible - but sadly it doesn't work. No error messages, but the table doesn't get created.

I'm using SQL 2005 June CTP if that helps.

Any ideas ?

thanks
Bruce

Here are the details we want:
1) Where is this Store Proc executed and how?

Note: SQL Mobile does not support stored procs in its Database. However you can use RDA.SubmitSql to execute a stored proc, available in SQL Server DB, on SQL Server remotely from SQL Mobile device.

2) SQL Statement in "RDA.Pull" command can only be some thing like
"SELECT col1, col2, col3 from testTable where col4 = 'TEST'".

It CANNOT be some thing like
"Execute sp_createformattedtemptable testTable".

If you want to acheive the functionality you are mentionig, you can do this way:
Before you do RDA Pull, do a RDA Submit SQL and execute store proc. This store proc should create a table with the expected data in expected format. Then use RDA Pull to pull the table down to SQL Mobile device. And, then do RDA Submit SQL to delete the just created temp table.

Hope this helps!

Thanks,
Laxmi NRO, MSFT, SQL Mobile

RDA - multi table error for tracking

Hello,

I receive an error message when I try to Push data that the table is not tracked. However, when I try to turn on the tracking option it gives me an error that the table is a multi query table and therefore cannot be tracked. Here is my code to Pull the table.

string TPDAPull = string.Format("SELECT Table1.Field1,Table1.Field2, Table1.Field3, Table1.Field4, from Table1 Left Join Table2 on Table1.Field1 =Table2.Field1 WHERE Table2.Field12='{0}'", this.FindWorker(var));

rda.Pull("Table1", TPDAPull, rdaOleDbConnectString, RdaTrackOption.TrackingOn);

This table does not have a primary key. I was wondering what can I do in this situation? I do not want to Pull the whole table. Any suggestions would be greatly appreciated. I am working in VS 2005, NCF2.0, C#, WM5.0.

Thanks in advance!

What about using a subquery?|||

You could make a single table view and pull this instead (but the view must reference only ONE table).

A primary is required if using RDA tracking. See http://msdn2.microsoft.com/en-us/library/ms172971.aspx

"A primary key must be defined on the updatable recordset returned by the SELECT statement. "

|||

Thank you Erik and Graham for your replies. Erik I was wondering, can I use SubmitSql instead of Rda.push? The problem I am encountering is that I cannot change the schema of the SQL Server 2000 tables. Please let me know.

Thanks in advance!

|||Yes, of course you could use SubmitSQL, it can be used for any SQL statement that does not return rows (INSERT, EXEC sproc, UPDATE etc.)|||

Thanks Erik! I appreciate all your help.

RDA - multi table error for tracking

Hello,

I receive an error message when I try to Push data that the table is not tracked. However, when I try to turn on the tracking option it gives me an error that the table is a multi query table and therefore cannot be tracked. Here is my code to Pull the table.

string TPDAPull = string.Format("SELECT Table1.Field1,Table1.Field2, Table1.Field3, Table1.Field4, from Table1 Left Join Table2 on Table1.Field1 =Table2.Field1 WHERE Table2.Field12='{0}'", this.FindWorker(var));

rda.Pull("Table1", TPDAPull, rdaOleDbConnectString, RdaTrackOption.TrackingOn);

This table does not have a primary key. I was wondering what can I do in this situation? I do not want to Pull the whole table. Any suggestions would be greatly appreciated. I am working in VS 2005, NCF2.0, C#, WM5.0.

Thanks in advance!

What about using a subquery?|||

You could make a single table view and pull this instead (but the view must reference only ONE table).

A primary is required if using RDA tracking. See http://msdn2.microsoft.com/en-us/library/ms172971.aspx

"A primary key must be defined on the updatable recordset returned by the SELECT statement. "

|||

Thank you Erik and Graham for your replies. Erik I was wondering, can I use SubmitSql instead of Rda.push? The problem I am encountering is that I cannot change the schema of the SQL Server 2000 tables. Please let me know.

Thanks in advance!

|||Yes, of course you could use SubmitSQL, it can be used for any SQL statement that does not return rows (INSERT, EXEC sproc, UPDATE etc.)|||

Thanks Erik! I appreciate all your help.