sql ²Ù×÷
exec sp_rename 't_2.lname','lastname','column'
exec sp_rename ‘tabelname’,'new'
»ñµÃsqlÓï¾äµÄÖ´ÐÐʱ¼ä£º
SET STATISTICS TIME ON
// sql Óï¾ä£ºselect * from table
SET STATISTICS TIME OFF
´´½¨Ë÷Òý£ºCREATE INDEX mycolumn_index ON mytable (myclumn)
ɾ³ýË÷Òý£º
Drop index indexname on tablename£»
²é¿´±íµÄËùÓÐË÷Òý£º
exec sp_helpindex cz
CREATE NONCLUSTERED INDEX [index_4] ON [dbo].[cz201]
(
[quxian] ASC,
[time_] ASC
)
INCLUDE ( [m201]) WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY] £¨»¹²»ÖªµÀÕâÆðʲô×÷Óã©
Ìí¼ÓÒ»ÁÐ
alter table mxm32 add newColumn varchar(200)
ÐÞ¸ÄÁÐ
alter table mxm32 alter column newColumn int
Ïà¹ØÎĵµ£º
Student(S#,Sname,Sage,Ssex) ѧÉú±í
Course(C#,Cname,T#) ¿Î³Ì±í
SC(S#,C#,score) ³É¼¨±í
Teacher(T#,Tname) ½Ìʦ±í
ÎÊÌ⣺
1¡¢²éѯ“001”¿Î³Ì±È“002”¿Î³Ì³É¼¨¸ßµÄËùÓÐѧÉúµÄѧºÅ£»
select a.S# from (select s#,score from SC where C#='001') a,(select s#,score
fr ......
»·¾³´î½¨£º
windows MobileµÄ¿ª·¢»·¾³µÄ´î½¨ÕâÀï¾Í²»ËµÁË£¬²»Ã÷°×µÄÅóÓÑÔÚÍøÉÏËÑϼ´¿É¡£
²½Öè¸ÅÊö:
1£ºPCÉϵÄSQL SERVER ÐèÒª¿ªÆôÔ¶³ÌÁ¬½Ó¡£
2£ºMoblieÄ£ÄâÆ÷ÐèҪͨ¹ýActiveSyncÁ¬½Ó£¬Ê¹ÆäÄܹ»Í¨¹ýPCÁ¬Íø¡£(Èç¹ûÊÇÊÖ»úµÄ»°£¬ÐèÒªÄܹ»Í¨¹ýÎÞÏßÍøÂçÁ¬È뻥ÁªÍø)
Ïêϸ˵Ã÷£º
1:SQL Server 2005¿ªÆôÔ¶³ÌÁ¬ ......
1¡£°æ±¾£ºSql2008/2005
2¡£Ä¿µÄ£ºµ¼³öÖ¸¶¨µÄ±íÖÐËùÓÐÊý¾Ý£¬µ¼³ö¸ñʽΪ insert Óï¾ä
3¡£¾ßÌå²Ù×÷£º
1£©ÕÒµ½ÐèÒªµ¼³öµÄÊý¾Ý¿â£¬ÓÒ¼ü²Ëµ¥£¬ÈÎÎñ--¡µÉú³É½Å±¾
2£©½øÈëÏòµ¼£¬Ò»Â·ÏÂÒ»²½£¬×¢ÒâÑ¡ÔñÉú³É½Å±¾Ñ¡ÏîµÄʱºò£¬½«“±àдÊý¾ÝµÄ½Å±¾”ÉèÖÃΪ“True”¼´¿É
3£©±£´æÉú³ÉµÄSqlÎļþ ......
±êÇ©£ºÊý¾Ý·ÃÎÊ LINQ LINQ to SQL ²¿·Ö
ä¯ÀÀLINQ to SQL¹Øϵ Á½¸ö¹ØÁªµÄ±í£º
& ......
ËùνÊÓͼ£¨View£©ÆäʵÊÇÖ´ÐвéѯÓï¾äºóµÃµ½µÄ½á¹û£¬µ«Õâ¸ö²éѯ½á¹û¿ÉÒÔ·ÂÕæ³ÉÊý¾Ý±íÀ´Ê¹Óã¬ËùÒÔÓÐÈËÒ²³ÆËüΪ“ÐéÄâÊý¾Ý±í”£¬ÊÓͼÔÚ²Ù×÷ÉϺÍÊý¾Ý±íûÓÐʲôÇø±ð£¬µ«Á½ÕߵIJîÒìÊÇÆä±¾ÖÊÊDz»Í¬µÄ£ºÊý¾Ý±íÊÇʵ¼Ê´æ´¢¼Ç¼µÄµØ·½£¬È»¶øÊÓͼ²¢²»±£´æÈκμǼ£¬Ëü´æ´¢µÄʵ¼ÊÉÏÊDzéѯÓï¾ä£¬ÆäËù³ÊÏÖ³ ......