SQL*PLUSÃüÁîµÄʹÓôóÈ«(ת)
OracleµÄsql*plusÊÇÓëoracle½øÐн»»¥µÄ¿Í»§¶Ë¹¤¾ß¡£ÔÚsql*plusÖУ¬¿ÉÒÔÔËÐÐsql*plusÃüÁîÓësqlÓï¾ä¡£
ÎÒÃÇͨ³£Ëù˵µÄDML¡¢DDL¡¢DCLÓï¾ä¶¼ÊÇsqlÓï¾ä£¬ËüÃÇÖ´ÐÐÍêºó£¬¶¼¿ÉÒÔ±£´æÔÚÒ»¸ö±»³ÆΪsql bufferµÄÄÚ´æÇøÓòÖУ¬²¢ÇÒÖ»Äܱ£´æÒ»Ìõ×î½üÖ´ÐеÄsqlÓï¾ä£¬ÎÒÃÇ¿ÉÒÔ¶Ô±£´æÔÚsql bufferÖеÄsql Óï¾ä½øÐÐÐ޸ģ¬È»ºóÔÙ´ÎÖ´ÐС£
³ýÁËsqlÓï¾ä£¬ÔÚsql*plusÖÐÖ´ÐеÄÆäËüÓï¾äÎÒÃdzÆ֮Ϊsql*plusÃüÁî¡£ËüÃÇÖ´ÐÐÍêºó£¬²»±£´æÔÚsql bufferµÄÄÚ´æÇøÓòÖУ¬ËüÃÇÒ»°ãÓÃÀ´¶ÔÊä³öµÄ½á¹û½øÐиñʽ»¯ÏÔʾ£¬ÒÔ±ãÓÚÖÆ×÷±¨±í¡£
ÏÂÃæ¾Í½éÉÜÒ»ÏÂһЩ³£ÓõÄsql*plusÃüÁî¡£
1. Ö´ÐÐÒ»¸öSQL½Å±¾Îļþ
SQL>start file_name
SQL>@ file_name
ÎÒÃÇ¿ÉÒÔ½«¶àÌõsqlÓï¾ä±£´æÔÚÒ»¸öÎı¾ÎļþÖУ¬ÕâÑùµ±ÒªÖ´ÐÐÕâ¸öÎļþÖеÄËùÓеÄsqlÓï¾äʱ£¬ÓÃÉÏÃæµÄÈÎÒ»ÃüÁî¼´¿É£¬ÕâÀàËÆÓÚdosÖеÄÅú´¦Àí¡£
2. ¶Ôµ±Ç°µÄÊäÈë½øÐбà¼
SQL>edit »ò ed
3. ÖØÐÂÔËÐÐÉÏÒ»´ÎÔËÐеÄsqlÓï¾ä
SQL>/ »òrun
4. ½«ÏÔʾµÄÄÚÈÝÊä³öµ½Ö¸¶¨Îļþ
SQL> SPOOL file_name
ÔÚÆÁÄ»ÉϵÄËùÓÐÄÚÈݶ¼°üº¬ÔÚ¸ÃÎļþÖУ¬°üÀ¨ÄãÊäÈëµÄsqlÓï¾ä¡£
5. ¹Ø±ÕspoolÊä³ö
SQL> SPOOL OFF
Ö»ÓйرÕspoolÊä³ö£¬²Å»áÔÚÊä³öÎļþÖп´µ½Êä³öµÄÄÚÈÝ¡£
6. ÏÔʾһ¸ö±íµÄ½á¹¹
SQL> desc table_name
7. COLÃüÁî
Ö÷Òª¸ñʽ»¯ÁеÄÏÔʾÐÎʽ¡£
¸ÃÃüÁîÓÐÐí¶àÑ¡Ï¾ßÌåÈçÏ£º
COL[UMN] [{ column|expr} [ option ...]]
OptionÑ¡Ïî¿ÉÒÔÊÇÈçϵÄ×Ó¾ä:
ALI[AS] alias
CLE[AR]
FOLD_A[FTER]
FOLD_B[EFORE]
FOR[MAT] format
HEA[DING] text
JUS[TIFY] {L[EFT]|C[ENTER]|C[ENTRE]|R[IGHT]}
LIKE { expr|alias}
NEWL[INE]
NEW_V[ALUE] variable
NOPRI[NT]|PRI[NT]
NUL[L] text
OLD_V[ALUE] variable
ON|OFF
WRA[PPED]|WOR[D_WRAPPED]|TRU[NCATED]
1). ¸Ä±äȱʡµÄÁбêÌâ
COLUMN column_name HEADING column_heading
Àý£º
SQL>select * from dept;
DEPTNO DNAME LOC
---------- ---------------------------- ---------
10 ACCOUNTING &nbs
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
´ËÎÊÌâÕÛÌÚ°ëÌì,googleÒ²ËÑË÷ÁË,ÍøÉϺܶàÅóÓÑÒ»°ã×öµ½µÚ¶þ²½²»³É¹¦,ÎÒÒ²²îµã·ÅÆúÁË.×îºóͨ¹ýµÚÈý²½Á¬½Ó³É¹¦ÁË.
1.·À»ðǽÔÊÐí1433
2.ÅäÖù¤¾ßÀïµÄSQL Server ÅäÖùÜÀíÆ÷.´ò¿ªºó,¿ªÆôÓÒ±ßÈý¸öÐÒé.²¢¶Ôtcp/ipÈçÏÂÅäÖÃ
3.ÍøÉϴ󲿷Ö×öµ½µÚ¶þ°æÖØÆôsql server·þÎñ,ÈÔÈ»ÎÞЧ.Æäʵ,ÐèÒªÐÞ¸ÄÁ¬½Ó×Ö·û´®.Ö¸¶¨ÎÒÃÇÅäÖõĶ ......
1.²éѯ³öµ±Ç°Á¬½ÓÈ»ºó½«Æä¹Ø±Õ
select spid
from master.dbo.sysprocesses
where dbid= db_id('Êý¾Ý¿âÃû')
--db_id('DoNet')
Èçspid ֵΪ 52.
2. 執ÐÐ:
kill 52
3.ÐÞ¸Ä數據庫Ãû
EXEC sp_dboption 'old_db_name', 'Single User', 'false'
&nb ......
ÔÚ²éѯ·ÖÎöÆ÷ÒÔ“Îı¾ÏÔʾ½á¹û”·½·¨Ö´ÐÐ
exec UspOutputData ÄãµÄ±íÃû
µÃµ½µ¼³öÊý¾ÝµÄÓï¾ä£¬µ«image,text,ntext,sql_variant Áв»³öÏÖÔÚÓï¾ä£¬ÒÔºó¸Ä½ø¡£
´æ´¢¹ý³ÌUspOutputDataÈçÏ£º
CREATE PROCEDURE  ......
.SQL SERVERµÄÊý¾ÝÀàÐÍ
Êý¾ÝÀàŪÊÇÊý¾ÝµÄÒ»ÖÖÊôÐÔ£¬±íʾÊý¾ÝËù±íʾÐÅÏ¢µÄÀàÐÍ¡£ÈκÎÒ»ÖÖ¼ÆËã»úÓïÑÔ¶¼¶¨ÒåÁË×Ô¼ºµÄÊý¾ÝÀàÐÍ¡£µ±È»£¬²»Í¬µÄ³ÌÐòÓïÑÔ¶¼¾ßÓв»Í¬µÄÌص㣬Ëù¶¨ÒåµÄÊý¾ÝÀàÐ͵ĸ÷ÀàºÍÃû³Æ¶¼»ò¶à»òÉÙÓÐЩ²»Í¬¡£SQLServer ÌṩÁË 25 ÖÖÊý¾ÝÀàÐÍ£º
·Binary [(n)]
·Varbinary [ ......