Click here to Skip to main content
15,903,033 members
Home / Discussions / Database
   

Database

 
AnswerRe: Index with two columns of table Pin
Corporal Agarn3-Jan-11 5:13
professionalCorporal Agarn3-Jan-11 5:13 
Questionlack of index in mysql document Pin
followait31-Dec-10 16:50
followait31-Dec-10 16:50 
QuestionJoin and Update statement using junction table and sql Pin
jboyd11130-Dec-10 10:19
jboyd11130-Dec-10 10:19 
AnswerRe: Join and Update statement using junction table and sql Pin
Luc Pattyn30-Dec-10 10:34
sitebuilderLuc Pattyn30-Dec-10 10:34 
GeneralRe: Join and Update statement using junction table and sql Pin
jboyd11130-Dec-10 16:06
jboyd11130-Dec-10 16:06 
AnswerRe: Join and Update statement using junction table and sql Pin
Luc Pattyn30-Dec-10 23:24
sitebuilderLuc Pattyn30-Dec-10 23:24 
GeneralRe: Join and Update statement using junction table and sql Pin
jboyd1113-Jan-11 8:50
jboyd1113-Jan-11 8:50 
AnswerRe: Join and Update statement using junction table and sql Pin
Jörgen Andersson3-Jan-11 23:36
professionalJörgen Andersson3-Jan-11 23:36 
I think you're thinking a bit wrong here (Alternatively have I understood you wrong).
There's no real point in updating the UserRoles table. You want to add or remove roles a user have. There's nothing to update really.

So you should rather think along the line of Insert and Delete instead.
For example something similar to:
Insert Into UserRoles (UserID,RoleID)
Values ((Select Userid from Users Where UserName = 'someuser'),(Select RoleID from Roles Where Rolename = 'Administrator'))
Or:
Delete From UserRoles
Where Userid = (Select Userid from Users Where UserName = 'someuser')
And Roleid = (Select RoleID from Roles Where Rolename = 'Administrator')


"When did ignorance become a point of view" - Dilbert

GeneralRe: Join and Update statement using junction table and sql Pin
jboyd1115-Jan-11 11:13
jboyd1115-Jan-11 11:13 
Questionsp_databases dosn't return any value in Sql server 2008 express. Pin
prasadbuddhika29-Dec-10 23:43
prasadbuddhika29-Dec-10 23:43 
AnswerRe: sp_databases dosn't return any value in Sql server 2008 express. Pin
Simon_Whale30-Dec-10 0:35
Simon_Whale30-Dec-10 0:35 
GeneralRe: sp_databases dosn't return any value in Sql server 2008 express. Pin
prasadbuddhika30-Dec-10 0:42
prasadbuddhika30-Dec-10 0:42 
GeneralRe: sp_databases dosn't return any value in Sql server 2008 express. Pin
Simon_Whale30-Dec-10 0:44
Simon_Whale30-Dec-10 0:44 
GeneralRe: sp_databases dosn't return any value in Sql server 2008 express. Pin
prasadbuddhika30-Dec-10 1:13
prasadbuddhika30-Dec-10 1:13 
GeneralMessage Removed Pin
30-Dec-10 2:25
professionalCorporal Agarn30-Dec-10 2:25 
GeneralRe: sp_databases dosn't return any value in Sql server 2008 express. Pin
Simon_Whale30-Dec-10 2:44
Simon_Whale30-Dec-10 2:44 
GeneralRe: sp_databases dosn't return any value in Sql server 2008 express. Pin
Corporal Agarn30-Dec-10 2:45
professionalCorporal Agarn30-Dec-10 2:45 
GeneralRe: sp_databases dosn't return any value in Sql server 2008 express. Pin
Simon_Whale30-Dec-10 3:17
Simon_Whale30-Dec-10 3:17 
QuestionCan you tell how to Sort in Oracle DB? Pin
openboy201029-Dec-10 22:21
openboy201029-Dec-10 22:21 
AnswerRe: Can you tell how to Sort in Oracle DB? [modified] Pin
badprog30-Dec-10 3:46
badprog30-Dec-10 3:46 
GeneralRe: Can you tell how to Sort in Oracle DB? Pin
openboy201030-Dec-10 4:58
openboy201030-Dec-10 4:58 
QuestionRe: Can you tell how to Sort in Oracle DB? Pin
badprog30-Dec-10 5:14
badprog30-Dec-10 5:14 
AnswerRe: Can you tell how to Sort in Oracle DB? Pin
openboy201030-Dec-10 5:20
openboy201030-Dec-10 5:20 
AnswerRe: Can you tell how to Sort in Oracle DB? Pin
badprog30-Dec-10 5:32
badprog30-Dec-10 5:32 
GeneralRe: Can you tell how to Sort in Oracle DB? Pin
openboy201030-Dec-10 13:58
openboy201030-Dec-10 13:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.