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

SQL SERVER ¹Ø¼üϵͳ±í˵Ã÷

sysobjects ±í
ÔÚÊý¾Ý¿âÄÚ´´½¨µÄÿ¸ö¶ÔÏó£¨Ô¼Êø¡¢Ä¬ÈÏÖµ¡¢ÈÕÖ¾¡¢¹æÔò¡¢´æ´¢¹ý³ÌµÈ£©ÔÚ±íÖÐÕ¼Ò»ÐС£Ö»ÓÐÔÚ tempdb ÄÚ£¬Ã¿¸öÁÙʱ¶ÔÏó²ÅÔڸñíÖÐÕ¼Ò»ÐС£
ÁÐÃû Êý¾ÝÀàÐÍ ÃèÊö
name sysname ¶ÔÏóÃû¡£
Id int ¶ÔÏó±êʶºÅ¡£
xtype char(2) ¶ÔÏóÀàÐÍ¡£¿ÉÒÔÊÇÏÂÁжÔÏóÀàÐÍÖеÄÒ»ÖÖ£º
C = CHECK Ô¼Êø
D = ĬÈÏÖµ»ò DEFAULT Ô¼Êø
F = FOREIGN KEY Ô¼Êø
L = ÈÕÖ¾
FN = ±êÁ¿º¯Êý
IF = ÄÚǶ±íº¯Êý
P = ´æ´¢¹ý³Ì
PK = PRIMARY KEY Ô¼Êø£¨ÀàÐÍÊÇ K£©
RF = ¸´ÖÆɸѡ´æ´¢¹ý³Ì
S = ϵͳ±í
TF = ±íº¯Êý
TR = ´¥·¢Æ÷
U = Óû§±í
UQ = UNIQUE Ô¼Êø£¨ÀàÐÍÊÇ K£©
V = ÊÓͼ
X = À©Õ¹´æ´¢¹ý³Ì
uid smallint ËùÓÐÕ߶ÔÏóµÄÓû§ ID¡£
info smallint ±£Áô¡£½öÏÞÄÚ²¿Ê¹Óá£
status int ±£Áô¡£½öÏÞÄÚ²¿Ê¹Óá£
base_schema_
ver int ±£Áô¡£½öÏÞÄÚ²¿Ê¹Óá£
replinfo int ±£Áô¡£¹©¸´ÖÆʹÓá£
parent_obj int ¸¸¶ÔÏóµÄ¶ÔÏó±êʶºÅ£¨ÀýÈ磬¶ÔÓÚ´¥·¢Æ÷»òÔ¼Êø£¬¸Ã±êʶºÅΪ±í ID£©¡£
crdate datetime ¶ÔÏóµÄ´´½¨ÈÕÆÚ¡£
ftcatid smallint ΪȫÎÄË÷Òý×¢²áµÄËùÓÐÓû§±íµÄÈ«ÎÄĿ¼±êʶ·û£¬¶ÔÓÚûÓÐ×¢²áµÄËùÓÐÓû§±íÔòΪ 0¡£
schema_ver int °æ±¾ºÅ£¬¸Ã°æ±¾ºÅÔÚÿ´Î±íµÄ¼Ü¹¹¸ü¸Äʱ¶¼Ôö¼Ó¡£
stats_schema_
ver int ±£Áô¡£½öÏÞÄÚ²¿Ê¹Óá£
type char(2) ¶ÔÏóÀàÐÍ¡£¿ÉÒÔÊÇÏÂÁÐÖµÖ®Ò»£º
C = CHECK Ô¼Êø
D = ĬÈÏÖµ»ò DEFAULT Ô¼Êø
F = FOREIGN KEY Ô¼Êø
FN = ±êÁ¿º¯Êý
IF = ÄÚǶ±íº¯Êý
K = PRIMARY KEY »ò UNIQUE Ô¼Êø
L = ÈÕÖ¾
P = ´æ´¢¹ý³Ì
R = ¹æÔò
RF = ¸´ÖÆɸѡ´æ´¢¹ý³Ì
S = ϵͳ±í
TF = ±íº¯Êý
TR = ´¥·¢Æ÷
U = Óû§±í
V = ÊÓͼ
X = À©Õ¹´æ´¢¹ý³Ì
userstat smallint ±£Áô¡£
sysstat smallint ÄÚ²¿×´Ì¬ÐÅÏ¢¡£
indexdel smallint ±£Áô¡£
refdate datetime Áô×÷ÒÔºóʹÓá£
version int Áô×÷ÒÔºóʹÓá£
deltrig int ±£Áô¡£
instrig int ±£Áô¡£
updtrig int ±£Áô¡£
seltrig int ±£Áô¡£
category int ÓÃÓÚ·¢²¼¡¢Ô¼ÊøºÍ±êʶ¡£
cache smallint ±£Áô¡£
syscolumns ±í
ÿ¸ö±íºÍÊÓͼÖеÄÿÁÐÔÚ±íÖÐÕ¼Ò»ÐУ¬´æ´¢¹ý³ÌÖеÄÿ¸ö²ÎÊýÔÚ±íÖÐÒ²Õ¼Ò»ÐС£¸Ã±íλÓÚÿ¸öÊý¾Ý¿âÖС£
ÁÐÃû Êý¾ÝÀàÐÍ ÃèÊö
name sysname ÁÐÃû»ò¹ý³Ì²ÎÊýµÄÃû³Æ¡£
id int ¸ÃÁÐËùÊôµÄ±í¶ÔÏó ID£¬»òÓë¸Ã²ÎÊý¹ØÁªµÄ´æ´¢¹ý³Ì ID¡£
xtype tinyint systypes ÖеÄÎïÀí´æ´¢ÀàÐÍ¡£
typestat tinyint ½öÏÞÄÚ²¿Ê¹Óá£


Ïà¹ØÎĵµ£º

SQL Server2000 ½âÎöXML

DECLARE @HDOC INT --Îĵµ¾ä±ú
DECLARE @XMLSTRING VARCHAR(200) --XML×Ö·û´®
SET @xmlString ='<?xml version="1.0"?>
<ROOT>
<USER ID="1" Name="SBQCEL"/>
<USER ID="2" Name="PEACELI"/>
<USER ID="3" Name="SHEEPCHANG"/>
</ROOT>'
--ʹÓÃϵͳ´æ´¢ ......

SQL ¶à±íÁªºÏ²éѯ

ºÜÉÙÓÃjoin£¬Õâ´Îѧѧ£¬²¢±¸ÍüÁ½ÆªÎÄÕ£¡
ת×Ô£ºhttp://hcx-2008.javaeye.com/blog/285661
Á¬½Ó²éѯ
ͨ¹ýÁ¬½ÓÔËËã·û¿ÉÒÔʵÏÖ¶à¸ö±í²éѯ¡£Á¬½ÓÊǹØϵÊý¾Ý¿âÄ£Ð͵ÄÖ÷ÒªÌص㣬ҲÊÇËüÇø±ðÓÚÆäËüÀàÐÍÊý¾Ý¿â¹ÜÀíϵͳµÄÒ»¸ö±êÖ¾¡£
ÔÚ¹ØϵÊý¾Ý¿â¹ÜÀíϵͳÖУ¬±í½¨Á¢Ê±¸÷Êý¾ÝÖ®¼äµÄ¹Øϵ²»±ØÈ·¶¨£¬³£°ÑÒ»¸öʵÌåµÄËùÓÐÐÅÏ¢´æ·ÅÔÚÒ ......

Access µÄ SQL µÄ¼Ç¼¼äµÄ¼Ó¼õ¼ÆËã

Access µÄ SQL ÖУ¬¼ÆËãÏàÓ¦±àºÅµÄ¼Ç¼֮¼ä ¼Ó ¼õ µÄ²éѯÃüÁî
ÀýÈç ¼ÆËãIDΪ 6 µÄ ºÏ¼Æ ¼õÈ¥ ID Ϊ 2¡¢3¡¢4 ÒÔ¼°¼ÓÉÏ ID Ϊ 5 µÄºÏ¼Æ
SELECT SUM(R) AS ½á¹û
from
(
  SELECT ºÏ¼Æ  AS R from T1 WHERE (ID = 6) UNION
  SELECT -ºÏ¼Æ AS R from T1 WHERE (ID = 2) UNION
  SELECT -ºÏ¼Æ AS R f ......

SQL¾«»ªÊÕ¼¯

order by µÄÊýÖµÐÍÁé»îʹÓÃ
select * from table_a where id=p_id order by decode(º¯Êý,'asc',1,'desc',-1)*jsny;
¿ØÖÆÊÔͼµÄ·ÃÎÊʱ¼ä£º
6.create view ...
as
select ... from where exists(select x from dual where sysdate>=8:00am and sysdate<=5:00pm)
ÃîÓÃdecodeʵÏÖÅÅÐò
select * from tabnam ......

sql 2005ÕûºÏbatÄÚÈÝ

@ECHO OFF
ECHO /////////////////////////////////////////////////
ECHO // Microsoft SQL Server 2005 ÕûºÏ¡¢¼¯³ÉSP3
ECHO // Author  : cxygoo
ECHO // Date    : 2008-12-22
ECHO /////////////////////////////////////////////////
ECHO ÔËÐдËÅú´¦ÀíÇ°£¬µÃ½¨Ä¿Â¼£ºC:\SQL2005,C:\SQL200 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ