select a.name,b.collation from syscolumns a join syscolumns b ------a, 得出表中的列名,b,得出 collation on a.id =b.id where a.id=object_id('staff') and b.id=object_id('staff') and b.collation isnotnull -------------加上b.collation is not null,是为了只找出表中字符型列的排序规则名称,因为INT,SMALLINT它们为NULL,
select a.name,b.collationfrom syscolumns a join syscolumns b ------a, 得出表中的列名,b,得出 collation on a.id =b.idwhere a.id=object_id(staff) and b.id=object_id(staff) and b.collation is not n