lundi 22 juin 2015

sql dynamic func - how to make it work?

im working on SQL 2008 im doing an SP and it should look like: I have input parameter, @T Nvarchar(255) for example it gets 4 chars: 'a,b,c,d' i need to count the times that the chars appears in the same word BUT with diffrent combinations:

Count (a)
Count (b)
Count (c)
Count (d)
Count (a+b)
Count (a+c)
Count (a+d)
Count (b+c)
Count (b+d)
Count (a+b+c+d) --means a+b+c in the same word
Count (b+c+d)
Count (c+d)

it have to be Dynamic because a dont know the input. i could solve it but i need help on, how do i make all possible combinations dynamic? the input can be 10 chars long. may be there are any method or something? thanks for any help!

Aucun commentaire:

Enregistrer un commentaire