Dynamic number of parameters for FilterClause
-
28/شعبان/1431 08:16 ص
Hi again,
while digging deeper into my scenario i came across the problem of defining a SyncTable description with a set of multiple parameters. As far as i understood the docs this is not possible with the current CTP - but it would be a very handy feature.
Having a hard time to express what i mean i just give you an example:
SELECT * FROM MyTable WHERE MyColumn IN (4, 8, 15, 16, 23, 42)
<SyncTable Name="MyTable" FilterClause="[side].MyColumn IN (@MyFilterArray)">
جميع الردود
-
28/شعبان/1431 06:32 مالمشرف
What would be the SqlType of MyFilterArray? I dont think TSQL lets you specify an array. If your array length is always fixed then you can probably do the following
FilterClause="[side].MyColumn IN (@p1, @p2, @p3)"
Maheshwar Jayaraman - http://blogs.msdn.com/mahjayar -
29/شعبان/1431 07:27 ص
Well, yes, of course you are right. I just wanted to give a simple example of what i would like to achieve - somehow. As the topic says i am looking for a dynamic number of parameters. All i can think of is some kind of hackish workarrounds, e.g. defined a fixed list of parameters and fill them with placeholder values in case they are not all needed.
I was wondering if someone else comes up with a briliant idea?
-
29/شعبان/1431 08:26 مالمشرف
Not really as this is a property of the underlying SqlSyncProvider the service uses. The thing with dynamic filter values is that the provider still expects them to be same across sync sessions as it does not guarantee partition realignments if they change between sync calls. Hope that helps.
Maheshwar Jayaraman - http://blogs.msdn.com/mahjayar- تم وضع علامة كإجابة بواسطة M.Bi 01/رمضان/1431 06:55 ص