6
Answers

Select query in Claims Table.

Rohan

Rohan

2y
773
1

Hello every one Please let me know how to Implement select query in claims table. My claims table this type

Id UserId ClaimType ClaimValue

1  2           ABC           1

2 3            XYZ             2

Now how to get record based on ClaimType XYZ. I have try this query but not working

select * from Auth.AspNetUserClaims where ClaimType.XYZ='2'     

Answers (6)
3
Amit Mohanty

Amit Mohanty

16 52.2k 6.1m 2y
You can use below query.
  1. -- If you have ClaimType value  
  2. SELECT * FROM Auth.AspNetUserClaims WHERE ClaimType = 'XYZ';  
  3.   
  4. OR  
  5.   
  6. -- If you have ClaimValue value  
  7. SELECT * FROM Auth.AspNetUserClaims WHERE ClaimValue = 2; 
Accepted
2
Rohan

Rohan

NA 1.4k 127k 2y
Thanx  Amit Mohanty
2
Uttam Kumar

Uttam Kumar

535 2.3k 285k 2y
select * from Auth.AspNetUserClaims where ClaimType='XYZ'

Try this query

1
Murali P

Murali P

1.5k 216 25.3k 2y
SELECT * FROM Auth.Claims WHERE ClaimType.TrialStatus='active' - This query not working
 
If  the Auth.Claims table having the TrailStatus column datatype as Boolean then use like below
 
SELECT * FROM Auth.Claims WHERE ClaimType.TrialStatus= 1 
1
Rohan

Rohan

NA 1.4k 127k 2y
Any Help me
1
Rohan

Rohan

NA 1.4k 127k 2y

SELECT * FROM Auth.Claims WHERE ClaimType.TrialStatus='active'  - This query not working