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ÉÏ´´½¨Ë÷Òýºó£¬Í¬Ê±»á¶Ô¸ÃË÷ÒýÉϵÄÖµ½øÐÐÅÅÐò£¬µ«¶ÔÓÚÐÂÔö¼ÓµÄÖµ£¬Èç¹ûδÄܼ°Ê±¸üÐÂͳ¼ÆÐÅÏ¢£¬½«ÓпÉÄܵ¼ÖÂÅÅÐòµÄ»ìÂÒ£¬Ò²¾ÍÊÇûÓÐÅÅÐò¡£
ÕâÊDzúÉúÎÊÌâµÄÓï¾ä£º
Select * from V_L_IcStockProInEntry Where FInt ......
sql ·þÎñÆ÷½ÇÉ« Êý¾Ý¿â½ÇÉ«
·þÎñÆ÷½ÇÉ«
ËùÓеķþÎñÆ÷½ÇÉ«¶¼ÊÇ“¹Ì¶¨µÄ”½ÇÉ«£¬²¢ÇÒ£¬´ÓÒ»¿ªÊ¼¾Í´æÔÚÓÚÄÇÀï——×Ô°²×°ÍêSQL ServerµÄÄÇÒ»¿ÌÆð£¬Ä㽫ӵÓеÄËùÓзþÎñÆ÷½ÇÉ«¾ÍÒѾ´æÔÚÁË¡£
½Ç¡¡¡¡É«
ÌØ¡¡¡¡ÐÔ
sysadmin
¸Ã½ÇÉ«Äܹ»Ö´ÐÐSQL ServerÉϵÄÈκβÙ× ......
ÎÒ°²×°µÄÊÇsql server 2000ËĺÏÒ»°æ±¾£¬Õý³£Í¾¾¶Ö±½Ó°²×°ÊÇ×°²»Éϵģ¬Òª´òʲôSP3²¹¶¡£¬²»ÒªÀíËü£¬´ò¿ª°²×°°ü£¬Àï±ßÓиöMSDEĿ¼£¬Ö´ÐÐsetup.exe£¬°²×°ºÜ˳Àû£¬×°ÍêÖ®ºóÊÇûÓз´Ó¦µÄ£¬ÖØÆô¼ÆËã»ú£¬È»ºóÄÜ¿´µ½sql server·þÎñÒѾÆô¶¯£¬ÕâÑù£¬¾Í¿ÉÒÔÕý³£°²×°ÁË£¬Ö´Ðа²×°°ü¸ùĿ¼Ïµİ²×°³ÌÐò£¬°´Ìáʾһ²½ ......
Ê×ÏȵÃÏÂÔØÇý¶¯³ÌÐòµ½Î¢ÈíÍøÕ¾ÏÂÔØMicrosoft SQL Server 2005 JDBC Driver 1.2
½âѹMicrosoft SQL Server 2005 jdbc driver1.2.exe£¬°Ñsqljdbc_1.1¸´ÖƵ½%ProgramFiles%£¨Èç¹ûϵͳÔÚCÅÌÔòΪC:\Program Files£©¡£
ÉèÖÃ Classpath
JDBC Çý¶¯³ÌÐò²¢Î´°üº¬ÔÚ Java SDK ÖС£Òò´Ë£¬Èç¹ûҪʹÓøÃÇý¶¯³ÌÐò£¬±ØÐ뽫 classpath ......
SQL code
/*----------------------------------------------------------------
-- Author :feixianxxx(poofly)
-- Date :2010-04-20 20:10:41
-- Version:
-- Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (Intel X86)
Mar 29 2009 10:27:29
Copyright (c) 1988-2008 Microsoft Co ......