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

ʵÏÖÔ¶³ÌÁ¬½ÓSQL Server2005


Ê×ÏÈÅäÖÃSQLSERVER2005£º
´ò¿ª”Microsoft SQL Server Management Studio“Ö±½ÓÓÃWindows Óû§Á¬½Ó½øÈ룬ÔÙÔÚ“°²È«ÐÔ”ÖеēµÇ¼Ãû”Äڵēн¨µÇ¼Ãû”£¬Äã¾Í¶ÔÓ¦µÄÌíºÃ“È·¶¨”¾Í¿ÉÒÔÁË¡£
 
ÔÙÔÚÄã¶ÔÓ¦µÄ“Êý¾Ý¿â”Àï“°²È«ÐÔ”Óû§£¬°ÑÄ㽨µÄÓû§Ìí¼Ó½øÈ¥¡£
 
¹Ø¼üµØ·½£¬²é¿´“·þÎñÆ÷ ÊôÐÔ”ÔÚ “°²È«ÐԔѡÉÏ “SQL Server ºÍ Windows Éí·ÝÑé֤ģʽ”µã “È·¶¨”ϵͳ»áÌáʾÄãÖØÐÂÆô¶¯SQL Server Äã“Í£Ö¹”ÖØÆôһϾÍÅäºÃÁË¡£
 
´Ë°æ±¾µÄ Microsoft Windows ²»Ö§³Ö MUST_CHANGE Ñ¡Ïî
È¡ÏûÇ¿ÖÆÃÜÂë¹ýÆÚÑ¡Ïî
ÕâÑùÎÊÌâ¾Í½â¾öÁË
Êý¾Ý¿âÖ÷ÌåÔÚ¸ÃÊý¾Ý¿âÖÐÓµÓмܹ¹,ÎÞ·¨É¾³ý½â¾ö·½·¨
ÏÈɾ³ý´ËÓû§¶ÔÓ¦µÄ¼Ü¹¹£¬È»ºóÔÚɾ³ý¶ÔÓ¦µÄÓû§ ²½Öè 
1¡£SQL SERVER MANAGEMENT STUDIO--¡·Êý¾Ý¿â--¡·°²È«ÐÔ--¡·¹¹¼Ü£¬ÏÈɾ³ý¶ÔÓ¦µÄ¹¹¼Ü
2¡£SQL SERVER MANAGEMENT STUDIO--¡·Êý¾Ý¿â--¡·°²È«ÐÔ--¡·Óû§£¬É¾³ý¶ÔÓ¦µÄÓû§ ÆäËü·½·¨£º SQL2005ɾ³ýÓû§µÄʱºò£¬²úÉú“Êý¾Ý¿âÖ÷ÌåÔÚ¸ÃÊý¾Ý¿âÖÐÓµÓмܹ¹£¬ÎÞ·¨É¾³ý”µÄ½â¾ö°ì·¨ --Ö´ÐÐÈçÏÂSQLÓï¾ä ALTER AUTHORIZATION ON SCHEMA::db_owner TO dbo; --È»ºóÊÖ¶¯É¾³ý¾Í¿ÉÒÔÁË¡£


Ïà¹ØÎĵµ£º

aspÍøÕ¾ ACCESSתSQL SERVER 2000

»¨ÁËÁ½¸öÍíÉÏ°ïÅóÓѽ«Ò»¸öasp¿ª·¢µÄÍøÕ¾´ÓACCESSÊý¾Ý¿âתÏòSQL SERVER 2000. ÍøÉϲéÁËЩ×ÊÁÏ£¬¼ÓÉÏ×Ô¼ºµÄ¾­Àú£¬×ܽ᣺
1¡¢Ê×ÏÈ¿´asp µÄ³ÌÐòÖÐÊÇ·ñÓÐ on error resume next; Èç¹ûÓÐ,ÏÈ×¢Ê͵ô¡£·ñÔòºÜ¶à´íÎóÎÞ·¨±©Â¶³öÀ´
2¡¢´´½¨SQL SERVER Êý¾Ý±í¡£ ʹÓÃSQL SERVER 2000×Ô´øµÄÊý¾Ýµ¼ÈëÏòµ¼£¬½«ACCESSÊý¾Ý¿âÖеıí½á¹¹£¬ÒÔ¼ ......

SQLÓï·¨ÊÖ²á


 
 
SQLÓï·¨ÊÖ²á
Select
ÓÃ;£º
 ´ÓÖ¸¶¨±íÖÐÈ¡³öÖ¸¶¨µÄÁеÄÊý¾Ý
Óï·¨£º
 
SELECT column_name(s) from table_name
 
½âÊÍ£º
´ÓÊý¾Ý¿âÖÐÑ¡È¡×ÊÁÏÁУ¬²¢ÔÊÐí´ÓÒ»»ò¶à¸ö×ÊÁϱíÖУ¬Ñ¡È¡Ò»»ò¶à¸ö×ÊÁÏÁлò×ÊÁÏÐС£SELECT ³ÂÊöʽµÄÍêÕûÓï·¨Ï൱¸´ÔÓ£¬µ«Ö÷Òª×Ó¾ä¿ÉժҪΪ£º
SELECT select_ ......

join ºÍ UnionºÍSQL Union All µÄÇø±ð


SQL UNION ²Ù×÷·û
UNION ²Ù×÷·ûÓÃÓںϲ¢Á½¸ö»ò¶à¸ö SELECT Óï¾äµÄ½á¹û¼¯¡£
Çë×¢Ò⣬UNION ÄÚ²¿µÄ SELECT Óï¾ä±ØÐëÓµÓÐÏàͬÊýÁ¿µÄÁС£ÁÐÒ²±ØÐëÓµÓÐÏàËƵÄÊý¾ÝÀàÐÍ¡£Í¬Ê±£¬Ã¿Ìõ SELECT Óï¾äÖеÄÁеÄ˳Ðò±ØÐëÏàͬ¡£
SQL UNION Óï·¨
SELECT column_name(s) from table_name1
UNION
SELECT column_name(s) from table_na ......

½«Ð¡Ð´½ð¶îת»»ÎªÖÐÎÄ´óдµÄSQLº¯Êý

CREATE FUNCTION [dbo].[f_num_chn] (@num numeric(14,2))
RETURNS varchar(100) WITH ENCRYPTION --¼ÓÃÜ
AS
BEGIN
--°æȨËùÓУºpbsql
  DECLARE @n_data VARCHAR(20),@c_data VARCHAR(100),@n_str VARCHAR(10),@i int
  SET @n_data=RIGHT(SPACE(14)+CAST(CAST(ABS(@num*100) AS bigint) AS varchar(20)), ......

SQLÓï¾äÖÐNULLµÄÕæʵº¬Òå

NULL£¬±íʾ²»Ã÷È·¡¢Î´ÖªµÄÁÐÖµ
²âÊÔ±í£ºtestnull(id varchar(32))
Êý¾Ý¿â£ºSybase ASA11.0
ÐÐÊý¾Ý(''), (NULL)
Êý¾Ý¿âÑ¡ÏîansinullΪtrue(Ò²ÊÇASAÊý¾Ý¿âµÄĬÈÏÑ¡Ïî)ʱ£¬
select * from testnull where id = null
select * from testnull where id != null
½á¹û¾ùΪ¿Õ
select * from testnull where id is null
½á¹ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ