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

sqlÓï¾ä¼¯½õ

Ò»¡¢Ö÷ÒªÊÇÐèÒª¸üÐÂmssqlServer µÄʱºòÐèÒª½øÐÐһЩÊÇ·ñ´æÔÚµÄÅжϣ¬ÔÚmssql2000 ºÍ 2005 ÉϲâÊÔûÓÐŶÎÊÌâ
--//ÅжÏÊDZíTable_UserInfoÀïÊÇ·ñÓÐ×Ö¶Î
if not exists(select * from syscolumns where id=object_id('Table_UserInfo') and name='Tel') begin
ALTER table Table_UserInfo add Tel varchar(200)--Ôö¼Ó×Ö¶Î
--ALTER TABLE Table_UserInfo DROP COLUMN Tel--ɾ³ý×Ö¶Î
--ALTER TABLE table_name ALTER COLUMN Tel varchar(200) --ÐÞ¸Ä×Ö¶ÎÀàÐÍ
end
--//ÅжÏÒªÌí¼ÓÁеıíTable_UserInfoÖÐÊÇ·ñÓÐÖ÷¼ü
if exists(select 1 from sysobjects where parent_obj=object_id('Table_UserInfo') and xtype='PK') begin
select top 1 * from Table_UserInfo
end
--//ÅжϱíTable_StatÊÇ·ñÓÐË÷ÒýIndex_Other
IF EXISTS (SELECT * from dbo.sysindexes WHERE id = OBJECT_ID(N'[dbo].[Table_Stat]') AND name = N'Index_Other') begin
select top 1 * from Table_UserInfo
end
--// ÅжÏÊÇ·ñÓд洢¹ý³Ìpr_DoStatCount
IF EXISTS (SELECT * from dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[pr_DoStatCount]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) begin
DROP PROCEDURE [dbo].[pr_DoStatCount]
end
--ÅжÏÊÇ·ñÓд˱íTable_stat_Count
IF EXISTS (SELECT * from dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].Table_stat_Count') and OBJECTPROPERTY(id, N'IsUserTable') = 1) begin
DROP PROCEDURE [dbo].[Table_stat_Count]
end


Ïà¹ØÎĵµ£º

SQL ServerË÷Òýͳ¼ÆÐÅϢδ¼°Ê±¸üУ¬µ¼ÖÂÅÅÐò»ìÂÒ

½ñÌ죬Óöµ½ÁËÕâÑùµÄÒ»¸öÀý×Ó£º
SQL ServerË÷Òýͳ¼ÆÐÅϢδ¼°Ê±¸üУ¬µ¼ÖÂÅÅÐò»ìÂÒ
ÎÒÃÇÖªµÀ£¬ÔÚsql
serverÉÏ´´½¨Ë÷Òýºó£¬Í¬Ê±»á¶Ô¸ÃË÷ÒýÉϵÄÖµ½øÐÐÅÅÐò£¬µ«¶ÔÓÚÐÂÔö¼ÓµÄÖµ£¬Èç¹ûδÄܼ°Ê±¸üÐÂͳ¼ÆÐÅÏ¢£¬½«ÓпÉÄܵ¼ÖÂÅÅÐòµÄ»ìÂÒ£¬Ò²¾ÍÊÇûÓÐÅÅÐò¡£
ÕâÊDzúÉúÎÊÌâµÄÓï¾ä£º
Select * from V_L_IcStockProInEntry Where FInt ......

³£ÓÃSQLÃæÊÔÌâ £¨Ò»£©

Êý¾Ý¿âÃæÊÔ³£ÓòâÊÔÌâ(SQL Server)
ÌâÄ¿1
¡¡¡¡ÎÊÌâÃèÊö:
¡¡¡¡Îª¹ÜÀí¸ÚλҵÎñÅàѵÐÅÏ¢£¬½¨Á¢3¸ö±í:
¡¡¡¡S (S#,SN,SD,SA) S#,SN,SD,SA ·Ö±ð´ú±íѧºÅ¡¢Ñ§Ô±ÐÕÃû¡¢ËùÊôµ¥Î»¡¢Ñ§Ô±ÄêÁä
¡¡¡¡C (C#,CN ) C#,CN ·Ö±ð´ú±í¿Î³Ì±àºÅ¡¢¿Î³ÌÃû³Æ
¡¡¡¡SC ( S#,C#,G ) S#,C#,G ·Ö±ð´ú±íѧºÅ¡¢ËùÑ¡Ð޵Ŀγ̱àºÅ¡¢Ñ§Ï°³É¼¨
¡¡¡¡1. Ê¹Ó ......

DelphiʹÓÃiniÅäÖÃÎļþÁ¬½ÓMS SQLÊý¾Ý¿â

ºÜÔç×ö¹ýµÄÒ»¸ödelphiÏîÄ¿£¬°ÑÀïÃæÓõ½µÄ¼¼Êõ×ܽáһϣ¬Ö÷ÒªÊÇÕë¶ÔÏóÎÒÕâÑùµÄdelphiÐÂÊÖ£¬¼¼ÊõÉÏ×ö¸ö»ýÀÛ°É£¡
¼ÙÉèÎÒÃǵÄÊý¾Ý¿âÅäÖÃÎļþServerInfo.iniÄÚÈÝÈçÏ£º
[ServerInfo]  
ServerIP=192.168.1.5
SQLDBName=Data 
SQLUserID=sa  
SQLPwd=  
ÎÒÃǶ¨ÒåÒ»¸öÁ¬½ÓÊý¾Ý¿âµÄ¹ý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ