易截截图软件、单文件、免安装、纯绿色、仅160KB

可为NULL 但不能重复的SQL约束


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER   trigger   [dbo].[checkExamNo] on   [dbo].[student]
  for   insert,update    as  
  if   exists(select   examNo from   student where   isnull(examNo ,'')<>''   group     by   examNo  having   count(*)>1   )  
  rollback


相关文档:

航空公司管理系统(VC++ 与SQL 2005)

系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
      这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......

Orcale SQL优化

1.ORACLE采用自下而上的顺序解析WHERE子句,根据这个原理,表之间的连接必须写在其他WHERE条件之前, 那些可以过滤掉最大数量记录的条件必须写在WHERE子句的末尾. 
(低效) 
SELECT … from EMP E WHERE SAL > 50000 AND JOB = ‘MANAGER’ AND 25 < (SELECT COUNT(*) from EMP WHERE MGR=E. ......

一个多表嵌套查询的sql语句

select batch_no "批次号",get_id "分类" from (
select(
select plan1.batch_no from product_plan plan1 where plan1.item_no=(select head1.product_code from wo_head head1 where head1.order_no =bbb)) batch_no, 
(select decode(get_id,'BUY','外购件','MAK','自制件','MB','未定') from item where item_ ......

SQL Server连接远程数据源的基本方法

SQL Server连接远程数据源的基本方法有下面三种:
OPENDATASOURCE: The OPENDATASOURCE function is used to specify connection information for a remote data source by specifying the OLE DB provider and an initialization string. OPENDATASOURCE can be used directly within a SELECT, INSERT, UPDATE, or DELET ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号