1:判断某表是否存在某字段,不存在返回0,存在返回1
select count(1) from syscolumns where [id]=object_id( '数据库表名') and [name]='字段名'
2:查询某表某列中的最大值
select max( FieldName ) from TableName
3:判断表是否存在,不存在返回0,存在返回1
select count(*) from sysobjects where id = object_id(N'[BaoZhang]') and OBJECTPROPERTY(id, N'IsUserTable') = 1