SQLÖÐobject_idº¯ÊýµÄÓ÷¨
¾³£»á¿´¼ûÔÚSQL³ÌÐòµÄ¿ªÍ·ÓÐÕâÑùÒ»¾ä»°
if OBJECT_ID('tb') is not null
drop table tb
º¯ÊýÓï·¨ÊÇÕâÑù£º
int OBJECT_ID('objectname');
×÷ÓÃÊÇ¿´¶ÔÏóobjectnameÊÇ·ñ´æÔÚ¡£
ÆäÖвÎÊýobjectname±íʾҪʹÓõĶÔÏó£¬ÊÇchar»òÕßncharÀàÐÍ¡£
·µ»ØÖµÀàÐÍΪint£¬Èç¹û¶ÔÏó´æÔÚ£¬Ôò·µ»Ø´Ë¶ÔÏóÔÚϵͳÖеıàºÅ£¬Èô²»´æÔÚ£¬Ôò·µ»ØNULL
ËùÒÔÔÚ³ÌÐò¿ªÊ¼Ê¹ÓÃÕâ¾ä»°£¬¾ÍÊÇΪÁ˱ÜÃâ±íµÄÖظ´¶¨Òå³ö´í
Ïà¹ØÎĵµ£º
1¡¢×éºÏÓï¾äÖ´ÐÐ
BEGIN ATOMIC
±í´ïʽ1 ·ÖºÅ ¿Õ¸ñ/»Ø³µ
±í´ïʽ2 ·ÖºÅ ¿Õ¸ñ/»Ø³µ
END
2¡¢Ó¦¸ÃÏÞÖÆ·ÃÎÊȨÏÞµÄ±í£¨Ó¦¸Ã³·ÏúÕâЩ±íPUBLIC SELECT·ÃÎÊȨ£©
SYSCAT.DBAUTH
SYSCAT.TABAUTH
SYSCAT.PACKAGEAUTH
SYSCAT.INDEXAUTH
SYSCAT.COLAUTH
SYSCAT.PASSTHRUAUTH
SYSCAT.SCHEMAAUTH
±È½ÏÓÐÓõÄĿ¼± ......
select top Ò³´óС *
from table1
where id>
(select max (id) from
(select top ((Ò³Âë-1)*Ò³´óС) id from table1 order by id) as T) order by id ......
1.¶Ô²éѯ½øÐÐÓÅ»¯£¬Ó¦¾¡Á¿±ÜÃâÈ«±íɨÃ裬Ê×ÏÈÓ¦¿¼ÂÇÔÚ where ¼° order by Éæ¼°µÄÁÐÉϽ¨Á¢Ë÷Òý¡£
2.Ó¦¾¡Á¿±ÜÃâÔÚ where ×Ó¾äÖжÔ×ֶνøÐÐ null ÖµÅжϣ¬·ñÔò½«µ¼ÖÂÒýÇæ
·ÅÆúʹÓÃË÷Òý¶ø½øÐÐÈ«±íɨÃ裬È磺
select id from t where num is null
¿ÉÒÔÔÚnumÉÏÉèÖÃ
ĬÈÏÖµ0£¬È·±£±íÖÐnumÁÐûÓÐnullÖµ£¬È»ºóÕâ
Ñù²éѯ£º
sel ......