sql ÖÐOBJECT_ID º¯ÊýµÄ½âÊÍ
ÔÚÁгö±íÖÐËùÓÐ×Ö¶ÎÃûµÄʱºò£¬Óõ½ÁËÕâÑùÒ»¸öSQLº¯Êý£ºobject_id
ÕâÀïÎÒ½«Æä×÷ÓÃÓëÓ÷¨ÁгöÀ´£¬ºÃÈôó¼ÒÃ÷°×£º
OBJECT_ID£º
·µ»ØÊý¾Ý¿â¶ÔÏó±êʶºÅ¡£
Óï·¨
OBJECT_ID ( 'object' )
²ÎÊý
'object'
ҪʹÓõĶÔÏó¡£object µÄÊý¾ÝÀàÐÍΪ char »ò nchar¡£Èç¹û object µÄÊý¾ÝÀàÐÍÊÇ char£¬ÄÇôÒþÐÔ½«Æäת»»³É nchar¡£
·µ»ØÀàÐÍ
int
×¢ÊÍ
µ±¸Ã²ÎÊý¶Ôϵͳº¯Êý¿Éѡʱ£¬Ôòϵͳ²ÉÓõ±Ç°Êý¾Ý¿â¡¢Ö÷»ú¡¢·þÎñÆ÷Óû§»òÊý¾Ý¿âÓû§¡£ÄÚÖú¯ÊýºóÃæ±ØÐë¸úÔ²À¨ºÅ¡£
Èç¹ûÖ¸¶¨Ò»¸öÁÙʱ±íÃû£¬Ôò±ØÐëÔÚÁÙʱ±íÃûÇ°Ãæ¼ÓÉÏÊý¾Ý¿âÃû£¬ÀýÈ磺
SELECT OBJECT_ID('tempdb..#mytemptable')
ϵͳº¯Êý¿ÉÒÔÔÚÑ¡ÔñÁÐ±í¡¢WHERE ×Ó¾äºÍÈκÎÔÊÐíʹÓñí´ïʽµÄµØ·½Ê¹Óá£Óйظü¶àÐÅÏ¢£¬Çë²Î¼û±í´ïʽºÍ WHERE¡£
ʾÀý
ÏÂÃæµÄʾÀýΪ pubs Êý¾Ý¿âÖÐµÄ authors ±í·µ»Ø¶ÔÏó ID¡£
USE master
SELECT OBJECT_ID('pubs..authors')
ÏÂÃæÊǽá¹û¼¯£º
-----------
1977058079
(1 row(s) affected)
Ïà¹ØÎĵµ£º
winform주
//´æ´¢
private void MemoryImage()
{
string sql = "";
&nbs ......
˵¾ä´ó·Ï»°£¬ÄǾÍÊÇ“ºÏÀíµÄƽºâ¸÷ÖÖ×ÊÔ´µÄʹÓÃ,ÄÚ´æ,cpu,io µÈµÈ”¡£ÕâÒ²ÊǺÜÓеÀÀíµÄ£¬µ«ÊÇʵ¼Ê¾Í²»ºÃ×öÁË£¬ÈçºÎƽºâÄØ£¿
¾ßÌåµãµÄô£¬Í¨¹ý±È½Ï£¬Ó¦¸ÃÊÇÏìӦʱ¼ä×öΪÖ÷ÒªµÄÆÀÅÐÒòËØÁË¡£µ«ÊÇ¿ÉÄÜÓÉÓÚһЩ²»È·¶¨µÄÒòËØ£¬¿ÉÄÜ»á³öÏÖ£ºÕâ´ÎÅܵĿ죬²»µÈÓÚÏ´ÎÒ²ÅܵĿìÁË¡£
ÄǾÍÒª¸ù¾Ý±íµÄÊý¾ÝÁ¿µÄ±ä»¯£¬È·¶¨Ò»¸ö± ......
1¡¢select 1 from mytable;Óëselect anycol(Ä¿µÄ±í¼¯ºÏÖеÄÈÎÒâÒ»ÐУ© from mytable;Óëselect * from mytable ×÷ÓÃÉÏÀ´ËµÊÇûÓвî±ðµÄ£¬¶¼ÊDz鿴ÊÇ·ñÓмǼ£¬Ò»°ãÊÇ×÷Ìõ¼þÓõġ£select 1 from ÖеÄ1ÊÇÒ»³£Á¿£¬²éµ½µÄËùÓÐÐеÄÖµ¶¼ÊÇËü£¬µ«´ÓЧÂÊÉÏÀ´Ëµ£¬1>anycol>*£¬ÒòΪ²»Óòé×Öµä±í¡£
2¡¢²é¿´¼Ç¼ÌõÊý¿ÉÒÔÓÃselect ......
±³¾°£ºDB2µÄÊý¾Ý¿âÐÔÄܺÜÅ£X£¬µ«ÊÇÆäÎĵµÈ´ºÜ²î£¬ÓÈÆäÊÇ¿ª·¢²Î¿¼Îĵµ£¬¶¼ÊÇÓ¢Îĵģ¬ä¯ÀÀµÄʱºò»¹ºÜ²»ºÃÕÒ£¬ÐèÒªÉÏIBMµÄÍøÕ¾¿´£¬ÍøÕ¾Ò²³öÆæµÄÂý£¬¼«²»·½±ã£¬Èÿª·¢ÈËÔ±¾Ù²½Î¬¼è£¬ÕâÒ²ÐíÊÇIBM DB2µÄÓû§ÉÙ£¬ÊéÉÙ£¬×ÊÁÏÉÙµÄÔÒò¡£
££££££££££££££££££
´´½¨SQL´æ´¢¹ý³Ì£¨CREATE PROCEDURE (SQL) stat ......
sql×¢È룬ËùνSQL×¢È룬¾ÍÊÇͨ¹ý°ÑSQLÃüÁî²åÈëµ½Web±íµ¥µÝ½»»òÊäÈëÓòÃû»òÒ³ÃæÇëÇóµÄ²éѯ×Ö·û´®£¬×îÖÕ´ïµ½ÆÛÆ·þÎñÆ÷Ö´ÐжñÒâµÄSQLÃüÁ±ÈÈçÏÈÇ°µÄºÜ¶àÓ°ÊÓÍøվй¶VIP»áÔ±ÃÜÂë´ó¶à¾ÍÊÇͨ¹ýWEB±íµ¥µÝ½»²éѯ×Ö·û±©³öµÄ£¬ÕâÀà±íµ¥ÌرðÈÝÒ×Êܵ½SQL×¢Èëʽ¹¥»÷£®
¡¡¡¡µ±Ó¦ÓóÌÐòʹÓÃÊäÈëÄÚÈÝÀ´¹¹Ô춯 ......