select t1.tusergroupid,
       t1.fgroupname,
       t1.fnotes,
       t1.createby,
       t1.createdate,
       t1.changeby,
       t1.changedate,
       t1.siteid
from DSBCRM..tusergroup t1
where (t1.siteid = $siteid$ or t1.siteid is null) and $where$
