I took an application that has an SQL server. There are a few tables, but two of which I am worried about are the following:
QAProfile
---------
ProfileID <pk> -int
ProfileName
SecurityGroups -varchar(max)
SecurityGroups
--------------
GroupID <pk> -int
GroupName
My problem is that the SecurityGroups field is a list of GroupID values, separated by commas.
So, the Profile table is as follows:
--------------------------------------------
| ProfileID | ProfileName | SecurityGroups |
--------------------------------------------
| 1 | foo | ,1,13,34,56, |
--------------------------------------------
| 2 | bar | ,4,13,29,56, |
--------------------------------------------
A profile can have multiple security groups, and a security group can be in multiple profiles
Any suggestions on how to do this?
source
share