sql±àÒëÓëÖرàÒë
sql±àÒëÓëÖرàÒë
1.sp_recompile
ʹ´æ´¢¹ý³ÌºÍ´¥·¢Æ÷ÔÚÏ´ÎÔËÐÐʱÖØбàÒë¡£
2.sp_refreshview
Èç¹ûÊÓͼËùÒÀÀµµÄ»ù´¡¶ÔÏó·¢Éú¸ü¸Ä(Èç:±íÔö¼ÓÁËÒ»¸ö×Ö¶Î)£¬ÔòÊÓͼ²»»á×Ô¶¯¸üУ¬ÕâʱÐèÒªµ÷Óøô洢¹ý³ÌÀ´¶ÔÊÓͼ½øÐÐˢС£ÓÐÈË˵£¬ÖØдò¿ªÒ»ÏÂÊÓͼ¾Í¿ÉÒÔ¸üÐÂÊÓͼ£¬µ«ÎÒÊÔÁËûÓгɹ¦¡£
Àý1£ºË¢ÐÂÖ¸¶¨Ãû³ÆµÄÊÓͼ
sp_refreshview 'v_tblItem'
Àý2:Ë¢ÐÂÕû¸öÊý¾Ý¿âÖеÄËùÓÐÊÓͼ
CREATE PROCEDURE [dbo].[_Proc_CheckView](
@IsDelete bit=0 --ÊÇ·ñҪɾ³ýÎÞЧµÄÊÓͼ
)
AS
BEGIN
DECLARE @vName sysname ;
DECLARE @ErrorMessage nvarchar(200);
DECLARE @count int;
SET @count=0;
DECLARE @ErrorCount int;
SET @ErrorCount=0;
CREATE TABLE #temp(
ViewName nvarchar(776)
)
DECLARE refresh_cursor CURSOR FOR
SELECT Name from sysobjects
WHERE xtype = 'V'
AND category=0
order by crdate
FOR READ ONLY
OPEN refresh_cursor
FETCH NEXT from refresh_cursor
INTO @vName
WHILE @@FETCH_STATUS = 0
BEGIN
BEGIN try
exec sys.sp_refreshview @vName
END try
BEGIN catch
insert into #temp(ViewName)
&n
Ïà¹ØÎĵµ£º
SQLServerºÍOracleÊÇ´ó¼Ò¾³£Óõ½µÄÊý¾Ý¿â£¬Ôڴ˸Ðл×÷Õß×ܽá³öÕâЩ³£Óú¯ÊýÒÔ¹©´ó¼Ò²Î¿¼¡£
Êýѧº¯Êý£º
¡¡1.¾ø¶ÔÖµ
¡¡¡¡ S:SELECT abs(-1) value
¡¡¡¡ O:SELECT abs(-1) value from dual
2.È¡Õû(´ó)
¡¡¡¡ S:SELECT ceiling(-1.001) value
¡¡¡¡ O:SELECT ceil(-1.001) value from dual
3.È¡Õû£¨Ð¡£© ......
ÎÒÃÇʹÓÃoracleµÄÈ˶¼ÖªµÀ¿ÉÒÔͨ¹ýrownumαÁеõ½²éѯ½á¹ûÐòÁÐÇ°ÃæµÄÖ¸¶¨µÄÐУ¬ÎªÁËÏÂÃæ¸üºÃµÄ½øÐÐ˵Ã÷ÎÊÌ⣬ÎÒÃÇÏÈÀ´´´½¨Ò»¸öÊý¾Ý±ítable1£º
create table table1
(AAA integer primary key,
BBB varchar(30));
È»ºóÔÚtable1ÖвåÈë9ÌõÊý¾Ý£º
insert into table1 values (8, 'good');
insert into table1 values (7 ......
ÓÃASPʵÏÖSQL SERVERÊý¾Ý¿âµÄÔ¶³Ì¸üÐÂ
½ËÕʡͨÖÝÖ°Òµ¸ß¼¶ÖÐѧ Áõ¼Æºâ
΢ÈíµÄSQL Server ÊÇÒ»¸ö´óÐ͵ĹØϵÊý¾Ý¿âϵͳ£¬ËüΪÔÚ¸´ÔÓ»·¾³ÏÂÓÐЧµØʵÏÖÖØÒªÉÌÒµÓ¦ÓÃÌṩÁËÒ»¸öÇ¿ÓÐÁ¦µÄ¿Í»§/·þÎñÆ÷ƽ̨¡£Ëü½áºÏMicrosoft Windows NT²Ù×÷ϵͳµÄÄÜÁ¦£¬ÌṩÁËÒ»¸ö°²È«¡¢¿ÉÀ©Õ¹¡¢Ò×¹ÜÀí¡¢¸ß¶ËÐÔÄܵĿͻ§/·þÎñÆ÷Êý¾Ý¿âƽ̨¡£Õ ......
½ñÌìÖÕÓÚ°ÑÕâ¸öÎÊÌâ¸ø½â¾öÁË£º
²Î¿¼ÎÄÕ£ºhttp://blog.csdn.net/long2006sky/archive/2007/04/23/1576583.aspx
ʵÀý˵Ã÷£º
»·¾³£ºwin2k+sqlserver 2K+²éѯ·ÖÎöÆ÷
SQLSERVER·þÎñʵÀý ......
Sql Server ÖÐÒ»¸ö·Ç³£Ç¿´óµÄÈÕÆÚ¸ñʽ»¯º¯Êý
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVE ......