select c.column_name,b.name from sysconstraints a,sysobjects b,INFORMATION_SCHEMA.COLUMNS c where a.constid=b.id and (b.xtype='PK' or b.xtype='D') and object_name(parent_obj) = 'employee' and c.table_name='employee' and c.ordinal_position=case when b.xtype='pk' then a.colid+1 else a.colid end
where a.constid=b.id and (b.xtype='PK' or b.xtype='D')
and object_name(parent_obj) = 'employee' and c.table_name='employee'
and c.ordinal_position=case when b.xtype='pk' then a.colid+1 else a.colid end