Ò»Ö»²éѯSQLServer 2005ËùÓÐÐÅÏ¢µÄÓï¾ä
select
table_name=
(
case when t_c.column_id=1
then t_o.name
else ''
end
),
column_id=t_c.column_id,
column_name=t_c.name,
type=t.name,
max_length=t_c.max_length,
precision=isnull(t_c.precision,0),
scale=isnull(t_c.scale,0),
is_identity=case when t_c.is_identity=1 then '√' else '' end,
is_primary=
(
case when exists
(
select 1 from sys.indexes i,sys.index_columns ic,sys.objects o
where o.type='PK' and o.name=i.name and i.index_id=ic.index_id
and i.object_id=ic.object_id and ic.column_id=t_c.column_id
and o.parent_object_id=t_c.object_id
)
then '√'
else ''
end
),
is_nullable=case when t_c.is_nullable=1 then '√' else '' end,
default_value=isnull(c.definition,''),
description=isnull(e.value,''),
fk_column_name=isnull(f_c.name,''),
fk_table_name=isnull(f_o.name,'')
from sys.columns t_c
Ïà¹ØÎĵµ£º
1.oracle»·¾³
create table test
(
id number(4),
name varchar2(20)
)
ÔÚÒ»¸ösessionÖÐ
insert into test values(1,'aa');
ÔÚÁíÒ»¸ösessionÖÐ
select * from test1;
²éѯû±»×èÈû
2.sqlserver»·¾³
ÔÚÒ»¸ösessionÖÐ
insert into test values(1,'aa');
ÔÚÁíÒ»¸ösessionÖÐ
select * from test1;
²éѯ±»×èÈû(Ê ......
΢ÈíµÄSQL SERVERÌṩÁËÁ½ÖÖË÷Òý£º¾Û¼¯Ë÷Òý(clustered index£¬Ò²³Æ¾ÛÀàË÷Òý¡¢´Ø¼¯Ë÷Òý)ºÍ·Ç¾Û¼¯Ë÷Òý(nonclustered index£¬Ò²³Æ·Ç¾ÛÀàË÷Òý¡¢·Ç´Ø¼¯Ë÷Òý)……
(Ò»)ÉîÈëdz³öÀí½âË÷Òý½á¹¹
ʵ¼ÊÉÏ£¬Äú¿ÉÒÔ°ÑË÷ÒýÀí½âΪһÖÖÌØÊâµÄĿ¼¡£Î¢ÈíµÄSQL SERVERÌṩÁËÁ½ÖÖË÷Òý£º¾Û¼¯Ë÷Òý(clustered index£¬Ò²³Æ¾ÛÀàË÷Òý¡¢´ ......
Õâ¸öÊÇÎÒ¼ÓÈëµÄQQȺÀïÃæÒ»¸öÍøÓÑÎʵÄÎÊÌâ¡£Ëû˵һ¸ö±í×öÒ»¸öINSERT¶¼»á³¬Ê±¡£ÕýÀ§»óÄØ£¬ÏòȺÀïÃæµÄÈËÇóÖú¡£ÎҸպöÔÕâ·½ÃæÖªµÀµã£¬¾Í»Ø´ðÁË˵ҪÓÅ»¯¾Û¼¯Ë÷Òý¡£Ëû²»Ã÷°×¾ßÌå¸ÃÔõô×ö£¬ËƺõÒ²²»ÖªµÀʲôÊǾۼ¯Ë÷Òý¡£ÎÒ¶ÔËû˵Äã¿ÉÒÔ¿´¿´Äã²åÈë¼Ç¼ʱµÄ´ÅÅÌIOÊÇ·ñ±È½Ï¶à£¬Ëû˵ËûµÄ´ÅÅÌÒѾ»»³ÉÁËRAID£¬²»ºÃ²é¿´´ÅÅÌIO¡£OK, ÎÒ¼Ì ......
µ±ÔÚC#ÓïÑÔÖУ¬Á¬½ÓsqlÊý¾Ý¿âµÄʱºò£¬³£Óõ½sqlconnection½¨Á¢ÓëÊý¾Ý¿âµÄÁ¬½Ó¡£ Óï·¨ÈçÏ£º
String sqlcon = "***";//ÕâÀïÊÇÒ»¸ö×Ö·û´®£¬¾ßÌå¸úÊý¾Ý¿âµÄÑéÖ¤·½Ê½Óйء£
//sql server Éí·ÝÑéÖ¤ Á¬½Ó×Ö·û´®
private string ConnstrSqlServer = "server=·þÎñÆ÷Ãû³ ......