Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 comma seperated values

Author  Topic 

Arun.G
Yak Posting Veteran

81 Posts

Posted - 2010-05-26 : 01:43:21
I have one master table which contains dat

for example: Tableroles

roleid roles
1 trainee
2 leader
3 supervisor

etc,

Now I have another table: Tableprofile
ex:
prid name designation roles
1 aaa uuu 1,2

In role column i want to get the multiple roles for one person and also want to store that id of roles only, but in front end i have option to select only rolename from dropdown list, but in backend it should stored as id only

how to write query for this?

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2010-05-26 : 02:32:49
Split the data in Front end, it is much simple and effective.

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

Asken
Starting Member

38 Posts

Posted - 2010-05-27 : 05:39:45
I'd split the roles up in another table i.e.

CREATE TABLE TableProfileRole (
roleid int,
prid int
)

INSERT TableProfileRole VALUES (2, 1)
INSERT TableProfileRole VALUES (2, 2)

and join on that table as well. I don't really think storing referenced data as composite is good practice.


Reporting & Analysis Specialist
Helping others helps me get better...
Go to Top of Page
   

- Advertisement -