Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ɾ³ý±í×ֶεÄsqlÓï¾ä

°¥£¬»¹ÊÇÉÏÖܵÄÊÂÇéÁË£¬csdnµÄ²©¿Í×î½üÕ¦ÀÏÊÇ´ò²»¿ªÄØ£¡
»ù±¾Óï¾ä£ºAlter table ±íÃû drop Column ×Ö¶ÎÃû
Áíµ¥µ¥ÊÇÕâÑùÊDz»ÐеΣ¬»¹ÒªÉ¾³ý¶ÔÓ¦µÄ¹ØÏµµÎ¡£ÏÂÃæ¾Í°Ñ²éÕÒµ½µÄÄÇÆªÎÄÕÂÒýÓÃϰɣ¡
Ô­ÎĵØÖ·£ºhttp://hi.baidu.com/lisky119/blog/item/3c348c082573949c0a7b82d1.html
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:   lw
-- Create date: 2009-07-31
-- Description: Ç¿ÐÐɾ³ý±íÁÐ,¡¾ÎÞ´íÎó¡¿¡¾É¾³ý±íµÄÁÐ֮ǰһ¶¨ÒªÉ¾³ýÒÀÀµ£¬Ë÷Òý¡¿,²»È»»á±¨ºÜ¶à´íÎó
-- =============================================
alter PROCEDURE [dbo].[Delete_Column_Constraint]
(
@tablename nvarchar(50),
@columnname nvarchar(50)
)
AS
--ɾ³ýij×ֶεÄËùÓйØÏµ  
declare   tb   cursor   local   for  
--ĬÈÏÖµÔ¼Êø  
select   sql='alter   table   ['+b.name+']   drop   constraint   ['+d.name+']'  
from   syscolumns   a  
join   sysobjects   b   on   a.id=b.id  
join   syscomments   c   on   a.cdefault=c.id  
join   sysobjects   d   on   c.id=d.id  
where   b.name = @tablename  
and   a.name = @columnname  
union   all   --Íâ¼üÒýÓà 
select   s='alter   table   ['+c.name+']   drop   constraint   ['+b.name+']'  
from   sysforeignkeys   a  
join   sysobjects   b   on   b.id=a.constid  
join   sysobjects   c   on   c.id=a.fkeyid  
join   syscolumns   d   on   d.id=c.id   and  


Ïà¹ØÎĵµ£º

Oracle PL/SQLÖÐÈçºÎʹÓÃ%TYPEºÍ%ROWTYPE

¡¡
¡¡¡¡1. ʹÓÃ%TYPE
¡¡¡¡ÔÚÐí¶àÇé¿öÏ£¬PL/SQL±äÁ¿¿ÉÒÔÓÃÀ´´æ´¢ÔÚÊý¾Ý¿â±íÖеÄÊý¾Ý¡£ÔÚÕâÖÖÇé¿öÏ£¬±äÁ¿Ó¦¸ÃÓµÓÐÓë±íÁÐÏàͬµÄÀàÐÍ¡£ÀýÈ磬students±íµÄfirst_nameÁеÄÀàÐÍΪVARCHAR2(20),ÎÒÃÇ¿ÉÒÔ°´ÕÕÏÂÊö·½Ê½ÉùÃ÷Ò»¸ö±äÁ¿£º
¡¡¡¡DECLARE
¡¡¡¡ v_FirstName VARCHAR2(20);
¡¡
¡¡µ«ÊÇÈç¹ûfirst_nameÁе͍Òå¸Ä±äÁ ......

SQL´æ´¢¹ý³ÌʵÀý


Àý1 ´«ÈëÒ»¸ö²ÎÊý@username,ÅжÏÓû§ÊÇ·ñ´æÔÚ
-------------------------------------------------------------------------------
CREATE PROC IsExistUser
(
@username varchar(20),
@IsExistTheUser varchar(25) OUTPUT--Êä³ö²ÎÊý
)
as
SELECT @IsExistTheUser = count(username)
from users
WHERE username ......

SqlÓï¾ä

Update  Channel set Unit ='mg' ,
RunUpThreshold='10' ,
RunDownThreshold='10' ,
SafetyUpThreshold='10' ,
SafetyDownThreshold='10' 
where Bridge='001' and DeviceCode='AS'
and SensorCode='001' and Supplement='N'
set  £º ','
where: and ......

MySQL5.1ÄÚ±íתµ½MS SQL£¬±í½á¹¹Ó¦ÈçºÎÉèÖã¿

# MySQL-Front 5.1  (Build 4.2)
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
/*!40101 SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
/*!40103 SET SQL_NOTES='ON' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS */ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ