10-27-2008 03:00 PM
We have recently upgraded to ACT 2009 PRemium due to our need for wanting to get the SA password for data extraction and advanced reporting purposes.
I am trying to get through SQL, a list of the contacts within a particular group.
We have an application that basically lists all the groups. And then drilling down into those groups results in seeing the contacts associated with that group.
It's easy enough to do a simple sql for static groups thorugh the TBL_GROUP_CONTACT table. However, dynamic groups of which there are many in our system are a little more tricky.
So the question is really two fold.
How do i differentiate in SQL between a static group and dynamic group.
Secondly if someone does select a dynamic group how do i ontain the list of contacts for that group dynamically. Is there a view?
For static groups i simply pass the GROUPID through to the TBL_GROUP_CONTACT table and that provides me the list of contacts, but i can't do that for dynamic groups.
10-31-2008 04:14 PM
Are you saying you are just running SQL directly after connecting as "sa"? If that is so, column CONTACTQUERYTEXT in TBL_GROUP contains a string that, if executed as SQL, with return the dynamic contacts.
Above all else, be careful when using sa.You can damage your database very easily.
10-31-2008 06:05 PM
thanks for the advice. Yes we are connecting using SA account.
I've decided to use the SDK to get the contacts for a group, and let that deal with the dynamic and static groups.
I think SA account should be ok, it's only for extracting data for advanced reporting features.
10-31-2008 11:23 PM
Excellent choice, the SDK approach is absolutely the best way for you to do that. That isolates you from any implementation changes we might make in the future, as well as removes the possibility of accidents due to unnecessarily elevated permissions while using the sa account.
I didn't really harp on that before as I don't want to sound too preachy.