Skip to content

Instantly share code, notes, and snippets.

@johndstein
Created July 5, 2016 14:44
Show Gist options
  • Save johndstein/62c99a6bd2854d35567781105dadec5d to your computer and use it in GitHub Desktop.
Save johndstein/62c99a6bd2854d35567781105dadec5d to your computer and use it in GitHub Desktop.
Raisers Edge Attributes
select *
from dbo.ConstituentAttributes as ca
inner join dbo.CONSTITUENT as con on ca.PARENTID = con.id
inner join dbo.attributetypes as at on ca.attributetypesid = at.attributetypesid
inner join dbo.TABLEENTRIES as te on te.CODETABLESID = at.CODETABLESID
inner join dbo.CODETABLES as ct on ct.CODETABLESID = at.CODETABLESID
where at.recordtype = 1
and at.TYPEOFDATA > 5
-- codetables will tell you the category, (Ex. Magazine) and tableentries will tell you a specific value, (Ex, Spring 05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment