locked
FilterClause with SqlAzureSyncScopeProvisioning RRS feed

  • Question

  • Is this possible or is it not supported?

    Dim

     

    serverConfig As New SqlAzureSyncScopeProvisioning(scopeDesc)

    serverConfig.SetCreateTableDefault(DbSyncCreationOption.Skip)

    serverConfig.ObjectSchema =

    "dbo"

    serverConfig.Tables(

    "Person").FilterColumns.Add(New DbSyncColumnDescription("ID", "nvarchar(15)"))

    serverConfig.Tables(

    "Person").FilterClause = "dbo.Person_tracking.ID='123'"

    serverConfig.Apply(CnnAzure)




    I only get errors like ambigious columnname, or columnname not found.

    Monday, March 1, 2010 11:12 PM

Answers

  • have you tried changing the filter clause from "dbo.Person_tracking.ID='123'"  to "[side].[ID]='123'" ?

     
    • Marked as answer by KayWessel Tuesday, March 2, 2010 7:35 PM
    Tuesday, March 2, 2010 12:45 AM
  • Hello Kay,

    One question I have is, why are you using tracking table for filtering? "dbo.Person_tracking.ID='123'"

    Normally, you would filter on user table column / row. Tracking tables are not meant to be used directly by user.

    Patrick

    • Marked as answer by KayWessel Tuesday, March 2, 2010 7:35 PM
    Tuesday, March 2, 2010 5:57 PM

All replies

  • Hello KayWessel,

    Could you make sure you have the table created previous to provisioing?

    If not, you should not set it to skip creation.

    Also, how do you mean by is it not supported? What part of the code are you not sure whether it is supported?

    Thanks,

    Patrick
    Monday, March 1, 2010 11:47 PM
  • have you tried changing the filter clause from "dbo.Person_tracking.ID='123'"  to "[side].[ID]='123'" ?

     
    • Marked as answer by KayWessel Tuesday, March 2, 2010 7:35 PM
    Tuesday, March 2, 2010 12:45 AM
  • Thanks Patrick,

    Yes, the table exists on the server already. I've also got the tracking table for this table since I have already made another scope with a different scope name, on the same table.

    Since I am working with SqlAzureSyncScopeProvisioning and it is only a CTP, I thought it would be possible that the FilterClause was not working yet.


    Kay
    Tuesday, March 2, 2010 9:18 AM
  • Hello Kay,

    One question I have is, why are you using tracking table for filtering? "dbo.Person_tracking.ID='123'"

    Normally, you would filter on user table column / row. Tracking tables are not meant to be used directly by user.

    Patrick

    • Marked as answer by KayWessel Tuesday, March 2, 2010 7:35 PM
    Tuesday, March 2, 2010 5:57 PM
  • Thanks Patrick and JuneT!

    Changing the filter clause from "dbo.Person_tracking.ID='123'"  to "[side].[ID]='123'" did it !

    Kay
    Tuesday, March 2, 2010 7:37 PM
  • Hello Kay,

    I am glad that JuneT's answer helped. Just to clarify, filtering is done on side table like he mentions.

    http://msdn.microsoft.com/en-us/library/dd918848%28SQL.105%29.aspx

    Patrick

    Tuesday, March 2, 2010 9:51 PM