Thursday, December 06, 2007

This is an interesting little tidbit.     If you are using SQL Compact replicated down to a mobile device,  you often find that you want to clear out data on the handheld once it has been sent back to the server.

However rather than building an archiving process the simplest way to remove data is to filter it out.

Using SQL Server.   Its possible to set for any table a filter rule that achieves just this result.   

image

So by putting a where clause in that simply says where 1=0   means that once a record has been synchronised from mobile device back to server it is no longer on the mobile device.

Job done.

Technorati Tags:
Thursday, December 06, 2007 11:14:21 AM UTC  #    Comments [2]  | 
Monday, January 07, 2008 10:26:42 PM UTC
1 = 0, I can prove it!!

Let x = 1
It follows that:
x^2 = x
x^2 - 1 = x - 1
(x + 1)(x - 1) = x - 1
(x + 1) = 1
x = 0

Substitute for x:
1 = 0

QED
Monday, January 07, 2008 10:46:26 PM UTC
Wow, I'm impressed.

Thanks Bryan
Richard
Comments are closed.

Theme design by Jelle Druyts

Pick a theme: