Sql ServerÊý¾Ý¿â´¥·¢Æ÷ʵÀý½²½â
´¥·¢Æ÷
¶¨Ò壺 ºÎΪ´¥·¢Æ÷£¿ÔÚSQL ServerÀïÃæÒ²¾ÍÊǶÔijһ¸ö±íµÄÒ»¶¨µÄ²Ù×÷£¬´¥·¢Ä³ÖÖÌõ¼þ£¬´Ó¶øÖ´ÐеÄÒ»¶Î³ÌÐò¡£´¥·¢Æ÷ÊÇÒ»¸öÌØÊâµÄ´æ´¢¹ý³Ì¡£
³£¼ûµÄ´¥·¢Æ÷ÓÐÈýÖÖ£º·Ö±ðÓ¦ÓÃÓÚInsert , Update , Delete ʼþ¡£(SQL Server 2000¶¨ÒåÁËеĴ¥·¢Æ÷£¬ÕâÀï²»Ìᣩ
ÎÒΪʲôҪʹÓô¥·¢Æ÷£¿±ÈÈ磬ÕâôÁ½¸ö±í£º
Create Table Student( --ѧÉú±í
StudentID int primary key, --ѧºÅ
....
)
Create Table BorrowRecord( --ѧÉú½èÊé¼Ç¼±í
BorrowRecord int identity(1,1), --Á÷Ë®ºÅ
StudentID int , --ѧºÅ
BorrowDate datetime, --½è³öʱ¼ä
ReturnDAte Datetime, --¹é»¹Ê±¼ä
...
)
Óõ½µÄ¹¦ÄÜÓÐ:
1.Èç¹ûÎÒ¸ü¸ÄÁËѧÉúµÄѧºÅ,ÎÒÏ£ÍûËûµÄ½èÊé¼Ç¼ÈÔÈ»ÓëÕâ¸öѧÉúÏà¹Ø(Ò²¾ÍÊÇͬʱ¸ü¸Ä½èÊé¼Ç¼±íµÄѧºÅ);
2.Èç¹û¸ÃѧÉúÒ
Ïà¹ØÎĵµ£º
if object_id('[tb]') is not null
drop table [tb]
go
create table [tb]([id] int,[col1] varchar(8),[col2] int)
insert [tb]
select 1,'ºÓ±±Ê¡',0 union all
select 2,'ÐĮ̈ÊÐ',1 union all
select 3,'ʯ¼ÒׯÊÐ',1 union all
select 4,'ÕżҿÚÊÐ',1 union all
&n ......
master..xp_dirtree 'D:\',1,1 µÚÒ»¸ö1ÊÇÉî¶È£¬µÚ¶þ¸ö1ÊÇÎļþ
1. Ö´ÐÐ master..xp_dirtree 'c:\',1,1,ÕâÑù¿ÉÒÔ»ñÈ¡c:\ϵÄËùÓÐÎļþºÍÎļþ¼Ð,²»°üÀ¨×ÓÎļþ¼Ð¼°Îļþ
2. ÏÔʾÔÚtreeviewÖÐ,ÓñêÖ ......
1.oracle
sql = "SELECT column_name, data_type, data_length, nullable";
sql += " from user_tab_columns ";
sql += " where table_name='";
sql += $tableName;
sql += "'";
select * from user_tab_comments & ......