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

ÊÓͼµÄ´´½¨¼°Ê¹ÓÃ(sql server 2005)

ÊÓͼµÄ´´½¨¼°Ê¹ÓÃ(sql server 2005)
´´½¨Ò»¸öÐéÄâ±í£¬¸Ã±íÒÔÒ»ÖÖ±¸Ó÷½Ê½Ìṩһ¸ö»ò¶à¸ö±íÖеÄÊý¾Ý¡£CREATE VIEW ±ØÐëÊDzéѯÅú´¦ÀíÖеĵÚÒ»ÌõÓï¾ä¡£
 Transact-SQL Óï·¨Ô¼¶¨
Óï·¨
 
CREATE VIEW [ schema_name . ] view_name [ (column [ ,...n ] ) ]
[ WITH <view_attribute> [ ,...n ] ]
AS select_statement [ ; ]
[ WITH CHECK OPTION ]
<view_attribute> ::=
{
    [ ENCRYPTION ]
    [ SCHEMABINDING ]
    [ VIEW_METADATA ]     } 
 
±¸×¢
Ö»ÄÜÔÚµ±Ç°Êý¾Ý¿âÖд´½¨ÊÓͼ¡£ÊÓͼ×î¶à¿ÉÒÔ°üº¬ 1,024 ÁС£
ͨ¹ýÊÓͼ½øÐвéѯʱ£¬Êý¾Ý¿âÒýÇæ ½«½øÐмì²éÒÔÈ·±£Óï¾äÖÐÈκÎλÖñ»ÒýÓÃËùÓÐÊý¾Ý¿â¶ÔÏ󶼴æÔÚ£¬ÕâЩ¶ÔÏóÔÚÓï¾äµÄÉÏÏÂÎÄÖÐÓÐЧ£¬ÒÔ¼°Êý¾ÝÐÞ¸ÄÓï¾äûÓÐÎ¥·´ÈκÎÊý¾ÝÍêÕûÐÔ¹æÔò¡£Èç¹û¼ì²éʧ°Ü£¬½«·µ»Ø´íÎóÏûÏ¢¡£Èç¹û¼ì²é³É¹¦£¬Ôò½«²Ù×÷ת»»Îª¶Ô»ù´¡±íµÄ²Ù×÷¡£
Èç¹ûij¸öÊÓͼÒÀÀµÓÚÒÑɾ³ýµÄ±í£¨»òÊÓͼ£©£¬Ôòµ±ÓÐÈËÊÔͼʹÓøÃÊÓͼʱ£¬Êý¾Ý¿âÒýÇæ ½«²úÉú´íÎóÏûÏ¢¡£Èç¹û´´½¨ÁËбí»òÊÓͼ£¨¸Ã±íµÄ½á¹¹ÓëÒÔÇ°µÄ»ù±íûÓв»Í¬Ö®´¦£©ÒÔÌ滻ɾ³ýµÄ±í»òÊÓͼ£¬ÔòÊÓͼ½«ÔٴοÉÓá£Èç¹ûбí»òÊÓͼµÄ½á¹¹·¢Éú¸ü¸Ä£¬Ôò±ØÐëɾ³ý²¢ÖØд´½¨¸ÃÊÓͼ¡£
´´½¨ÊÓͼʱ£¬ÓëÊÓͼÓйصÄÐÅÏ¢½«´æ´¢ÔÚÏÂÁÐĿ¼ÊÓͼÖУºsys.views¡¢sys.columns ºÍ sys.sql_dependencies¡£CREATE VIEW Óï¾äµÄÎı¾½«´æ´¢ÔÚ sys.sql_modules Ŀ¼ÊÓͼÖС£
¶Ôͨ¹ý numeric »ò float ±í´ïʽ¶¨ÒåµÄÊÓͼʹÓÃË÷ÒýËùµÃµ½µÄ²éѯ½á¹û£¬¿ÉÄܲ»Í¬ÓÚ²»¶ÔÊÓͼʹÓÃË÷ÒýµÄÀàËƲéѯËùµÃµ½µÄ½á¹û¡£ÕâÖÖ²îÒì¿ÉÄÜÊÇÓɶԻù´¡±í½øÐÐ INSERT¡¢DELETE »ò UPDATE ²Ù×÷ʱµÄÉáÈë´íÎóÒýÆðµÄ¡£
´´½¨ÊÓͼʱ£¬Êý¾Ý¿âÒýÇæ ½«±£´æ SET QUOTED_IDENTIFIER ºÍ SET ANSI_NULLS µÄÉèÖá£Ê¹ÓÃÊÓͼʱ£¬½«Ê¹ÓÃÕâЩԭʼÉèÖÃÀ´·ÖÎöÊÓͼ¡£Òò´Ë£¬·ÃÎÊÊÓͼʱ£¬SET QUOTED_IDENTIFIER ºÍ SET ANSI_NULLS µÄÈκοͻ§¶Ë»á»°ÉèÖö¼²»»áÓ°ÏìÊÓͼ¶¨Òå¡£
×¢Ò⣺ 
¼æÈݼ¶±ðÉèÖÃÈ·¶¨Êý¾Ý¿âÒýÇæ Êǽ«¿Õ×Ö·û´®½âÊÍΪµ¥¸ö¿Õ¸ñ»¹ÊÇÕæÕýµÄ¿Õ×Ö·û´®¡£Èç¹û¼æÈݼ¶±ðСÓÚ»òµÈÓÚ 65£¬ÔòÊý¾Ý¿âÒýÇæ ½«¿Õ×Ö·û´®½âÊÍΪµ¥¸ö¿Õ¸ñ¡£Èç¹û¼æÈݼ¶±ðµÈÓÚ»ò´óÓÚ 70£¬ÔòÊý¾Ý¿âÒýÇæ ½«¿Õ×Ö·û´®½âÊÍΪ¿Õ×Ö·û´®¡£ÓйØÏêϸÐÅÏ¢£¬Çë²ÎÔÄ sp_dbcmptlevel (Transact-SQL)¡£ 
 
¿É¸üÐÂÊÓͼ
Ö»ÒªÂú×ãÏÂÁÐÌõ¼þ£¬¼´¿Éͨ¹ýÊÓͼÐ޸Ļù´¡»


Ïà¹ØÎĵµ£º

ÖÕ¼¶½â¾öSQL Server 2005 δÕý³£Ð¶ÔØ£¬ÖØа²×°ÎÊÌâ

 ÔÚжÔØVisual Studio 2008 ʱ£¬Ìí¼Ó/ɾ³ý³ÌÐò ÀïÃæÓÐÐí¶àµÄ°²×°Îļþ£¬´ËʱÈç¹ûûÓÐÏÈжÔØSQL Server 2005 £¬
¶øÏÈжÔØ.Net Framework£¨Ìáʾ£ºÐ¶ÔØ.net FrameworkµÄµÃ°²°æ±¾´Ó¸ßµ½µÍµÄ˳Ðò£©£¬
ÕâʱSQL Server 2005¾ÍÎÞ·¨Ð¶ÔØ,ɾ³ýProgram files ÏÂÃæµÄ Microsoft SQL Server Îļþ¼ÐҲûÓÐ×÷Óá£
ÖØа²×°ÌáʾÊý¾Ý¿ ......

sql²éѯ×îºóÒ»ÌõÊý¾Ý

1¡¢ sql²éѯ×îºóÒ»ÌõÊý¾Ýselect * from table order by id DESC limit 1
2¡¢select top1 * from tablename where order by id desc
ͨ¹ýÔÚmysqlÖвâÊÔ£¬Ö»ÓеÚÒ»ÖÖ¿ÉÒÔʹÓ㬲»ÖªµÀÆäËûÊý¾Ý¿âÊÇ·ñÖ§³ÖµÚ¶þÖÖ·½·¨£¬ÍøÉϺܶàÈË˵ÓõڶþÖÖ·½·¨ ......

PL/SQLʵÏÖOracleÊý¾Ý¿âÈÎÎñµ÷¶È

 
     Ñ¡Ôñ×Ô softj µÄ Blog
¹Ø¼ü×Ö
  PL/SQLʵÏÖOracleÊý¾Ý¿âÈÎÎñµ÷¶È
³ö´¦
 
 
PL/SQLʵÏÖOracleÊý¾Ý¿âÈÎÎñµ÷¶È
¡¡¡¡¹Ø¼ü´Ê£ºÊý¾Ý»Ö¸´£¬ÈÎÎñµ÷¶È£¬ORACLE£¬PL/SQL
¡¡¡¡ÔÚÊý¾Ý¿â²Ù×÷ÖÐʱ³£»áÓÐÕâÑùµÄÇé¿ö·¢Éú£¬ÓÉÓÚһʱµÄÊèºö¶øÎóɾ»òÎó¸ÄÁËһЩÖØÒªµÄÊý¾Ý£¬ÁíÍ⻹ÓÐ ......

SQL SERVER Êý¾ÝÀàÐÍ

  bit    ÕûÐÍ bit Êý¾ÝÀàÐÍÊÇÕûÐÍ£¬ÆäÖµÖ»ÄÜÊÇ0¡¢1»ò¿ÕÖµ¡£ÕâÖÖÊý¾ÝÀàÐÍÓÃÓÚ´æ´¢Ö»ÓÐÁ½ÖÖ¿ÉÄÜÖµµÄÊý¾Ý£¬ÈçYes »òNo¡¢True »òFa lse ¡¢On »òOff int   ÕûÐÍ int Êý¾ÝÀàÐÍ¿ÉÒÔ´æ´¢´Ó- 231(-2147483648)µ½231 (2147483 647)Ö®¼äµÄÕûÊý¡£´æ´¢µ½Êý¾Ý¿âµÄ¼¸ºõËùÓÐÊýÖµÐ͵ÄÊý¾Ý¶¼¿ÉÒÔÓÃÕâÖÖÊý¾ ......

PowerShell±Ê¼Ç£¨Èý£©£ºµ÷ÓÃMS SQLÊý¾Ý¿â

ÊÔÁËÒ»°ÑPowerShell·ÃÎÊÊý¾Ý¿â£¬¸úÓÃC#д¼¸ºõûÈκÎÇø±ð~
ΪÁ˼òµ¥Æð¼û£¬´úÂëÓеã³ó£¬²»ÓÃÌ«É
$ConnString = "server=_SERVER_;database=_DATABASE_;user id=_UID_;password=_PWD_";
$db = New-Object System.Data.SqlClient.SqlConnection($ConnString);
$db.Open();
$Sql = "select top 10 * from sys.objects wh ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ