SQLË÷ÒýÓÅ»¯µÄÎÊÌâ
Õª×Ôhttp://hi.baidu.com/dusongw/blog/item/4090493d6ec0cdee3d6d97a6.html
ÎÒ½«ÒÔ“°ì¹«×Ô¶¯»¯”ϵͳΪÀý£¬Ì½ÌÖÈçºÎÔÚÓÐ×Å1000ÍòÌõÊý¾ÝµÄMS SQL SERVERÊý¾Ý¿âÖÐʵÏÖ¿ìËÙµÄÊý¾ÝÌáÈ¡ºÍÊý¾Ý·ÖÒ³¡£ÒÔÏ´úÂë˵Ã÷ÁËÎÒÃÇʵÀýÖÐÊý¾Ý¿âµÄ“ºìÍ·Îļþ”Ò»±íµÄ²¿·ÖÊý¾Ý½á¹¹£º
CREATE TABLE [dbo].[TGongwen] ( --TGongwenÊǺìÍ·Îļþ±íÃû
[Gid] [int] IDENTITY (1, 1) NOT NULL ,
--±¾±íµÄidºÅ£¬Ò²ÊÇÖ÷¼ü
[title] [varchar] (80) COLLATE Chinese_PRC_CI_AS NULL ,
--ºìÍ·ÎļþµÄ±êÌâ
[fariqi] [datetime] NULL ,
--·¢²¼ÈÕÆÚ
[neibuYonghu] [varchar] (70) COLLATE Chinese_PRC_CI_AS NULL ,
--·¢²¼Óû§
[reader] [varchar] (900) COLLATE Chinese_PRC_CI_AS NULL ,
--ÐèÒªä¯ÀÀµÄÓû§¡£Ã¿¸öÓû§ÖмäÓ÷ָô·û“,”·Ö¿ª
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ÏÂÃ棬ÎÒÃÇÀ´ÍùÊý¾Ý¿âÖÐÌí¼Ó1000ÍòÌõÊý¾Ý£º
declare @i int
set @i=1
while @i<=250000
begin
insert into Tgongwen(fariqi,neibuyonghu,reader,title) values('2004-2-5','ͨÐÅ¿Æ','ͨÐÅ¿Æ,°ì¹«ÊÒ,Íõ¾Ö³¤,Áõ¾Ö³¤,Õžֳ¤,admin,ÐÌÕìÖ§¶Ó,ÌØÇÚÖ§¶Ó,½»Ñ²¾¯Ö§¶Ó,¾ÕìÖ§¶Ó, »§Õþ¿Æ,Öΰ²Ö§¶Ó,ÍâÊ¿Æ','ÕâÊÇ×îÏȵÄ25ÍòÌõ¼Ç¼')
set @i=@i+1
end
GO
declare @i int
set @i=1
while @i<=250000
begin
insert into Tgongwen(fariqi,neibuyonghu,reader,title) values('2004-9-16','°ì¹«ÊÒ','°ì¹«ÊÒ,ͨÐÅ¿Æ,Íõ¾Ö³¤,Áõ¾Ö³¤,Õžֳ¤,admin,ÐÌÕìÖ§¶Ó,ÌØÇÚÖ§¶Ó,½»Ñ²¾¯Ö§¶Ó,¾ÕìÖ§¶Ó,»§Õþ¿Æ,ÍâÊ¿Æ','ÕâÊÇÖмäµÄ25ÍòÌõ¼Ç¼')
set @i=@i+1
end
GO
declare @h int
set @h=1
while @h<=100
begin
declare @i int
set @i=2002
while @i<=2003
begin 
Ïà¹ØÎĵµ£º
Microsoft SQL Server ÏÖÔھ߱¸Óë Microsoft Windows .NET Framework µÄ¹«¹²ÓïÑÔÔËÐÐʱ (CLR) ×é¼þ¼¯³ÉµÄ¹¦ÄÜ¡£CLR ΪÍйܴúÂëÌṩ·þÎñ£¬ÀýÈç¿çÓïÑÔ¼¯³É¡¢´úÂë·ÃÎÊ°²È«ÐÔ¡¢¶ÔÏóÉú´æÆÚ¹ÜÀíÒÔ¼°µ÷ÊԺͷÖÎöÖ§³Ö¡£¶ÔÓÚ SQL Server Óû§ºÍÓ¦ÓóÌÐò¿ª·¢ÈËÔ±À´Ëµ£¬CLR ¼¯³ÉÒâζ×ÅÄúÏÖÔÚ¿ÉÒÔʹÓÃÈκ ......
. SQL ÃüÁî
Õⲿ·Ö°üº¬ÄÇЩ PostgreSQL Ö§³ÖµÄ SQL ÃüÁîµÄÐÅÏ¢£®ÕâÀïµÄ "SQL" ¾ÍÊǸÃÓïÑÔͨ³£µÄº¬Ò壻 ÿÌõÃüÁîµÄÓë±ê×¼ÓйصļæÈÝÐÔµÄÐÅÏ¢¿ÉÒÔÔÚÏà¹ØµÄ²Î¿¼Ò³ÖÐÕÒµ½£®
Table of Contents
ABORT -- Í˳öµ±Ç°ÊÂÎñ
ALTER GROUP -- Ïò×éÖÐÔö¼ÓÓû§»ò´Ó×éÖÐɾ³ýÓû§
ALTER USER -- ¸Ä±äÊý¾Ý¿â ......
drop table #t
create table #t(req_spid int,obj_name sysname)
declare @s nvarchar(4000)
,@rid int,@dbname sysname,@id int,@objname sysnam ......
SQL Server ¼¸¸öºÃÓõÄSQLÓï¾ä
1¡¢¸´ÖƱí
select * into desttable from srctable
½« srctable ÍêÕûµØ¸´ÖÆÒ»·Ýµ½ desttable ÖУ¬µ±È»ºóÃæÒ²¿ÉÒÔ¼ÓÉÏÌõ¼þÀ´ÏÞ¶¨ÐèÒª¸´ÖƵļǼ
ÒªÇó£ºdesttable ±ØÐëΪ²»´æÔڵıíÃû¡£
insert into desttable(column1, column2) select columna, columnb from sr ......
Õ⼸ÌìÊÖÍ·¿ª·¢µÄϵͳҪ×öÒ»¸öÀàËÆwindowsÕË»§µ½ÆÚʱ¼äµÄ¹¦ÄÜ£¬¿¼ÂÇÁË°ëÌìÏë³öÁËÒ»¸ö¼¼ÊõÉϺÍÂß¼É϶¼»¹ÄÜʵÏֵĽâ¾ö·½°¸£º
´´½¨Ò»¸öÓû§´æÈëÊý¾Ý¿âµÄʱºò¶¼´´½¨Ò»¸öʼþµ÷¶ÈÆ÷À´¿ØÖÆÓû§µÄµ½ÆÚʱ¼ä£¨mysqlµÄʱ¼äµ÷¶ÈÆ÷ȷʵºÜ·½±ã£©¡£ÏëÆðÀ´ÊǺܼòµ¥£¬µ«ÊÇ×öÆðÀ´ÎÊÌâȷʵһ²¨½ÓÒ»²¨...
һЩСÎÊÌâ¾Í²» ......