SQl SERVER 2000 ±éÀú±íÖÐÊý¾ÝµÄ·½·¨
·½·¨Ò»£ºÊ¹ÓÃÓαê
declare @ProductName nvarchar(50)
declare pcurr cursor for select ProductName from Products
open pcurr
fetch next from pcurr into @ProductName
while (@@fetch_status = 0)
begin
print (@ProductName)
fetch next from pcurr into @ProductName
end
close pcurr
deallocate pcurr
´Ë·½·¨ÊÊÓÃËùÓÐÇé¿ö£¬¶Ô±ê½á¹¹Ã»ÓÐÌØÊâÒªÇó¡£
·½·¨¶þ£ºÊ¹ÓÃÑ»·
declare @ProductName nvarchar(50)
declare @ProductID int
select @ProductID=min(ProductID) from Products
while @ProductID is not null
begin
select @ProductName=ProductName from Products where
ProductID=@ProductID
print(@ProductName);
select @ProductID=min(ProductID) from Products where
ProductID>@ProductID
end
´Ë·½·¨ÊÊÓÃÓÚ±í´øÓÐ×Ô¶¯Ôö¼Ó±êʶµÄ×Ö¶Î
Ïà¹ØÎĵµ£º
1.Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)¡¡¡¡
¡¡¡¡ SQLSERVERµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬Òò´Ëfrom×Ó¾äÖÐдÔÚ×îºóµÄ±í£¨»ù´¡±ídriving table£©½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í£¬µ±SQLSERVER´¦Àí¶à¸ö±íʱ£¬»áÔËÓÃÅÅÐò¼°ºÏ²¢µÄ·½Ê½Á ......
×òÌì¿´µ½ÍøÉÏÓÐÒ»¸ö¹ØÓÚSQL SERVER ¿Î¼þ£¬±ãËæÊÖÏÂÔØÁËÏÂÀ´¿´¿´Ö÷Òª½²ÁËЩʲôÄÚÈÝ£¬ÓÚÊÇ¿´µ½ÁËÏÂÃæÁ½¸öPPTÒ³Ãæ
ÓÉÓÚµÚÒ»ÕÅPPTÉϵÄÄÚÈݲ»Ì«×¼È·£¨ÈÕÖ¾ÎļþÖÐûÓГÈÕÖ¾Ò³”µÄ¸ÅÄֻÓÐVLFµÄ¸ÅÄ¿ÉÄÜÊÇÎÒÃǶԓÊý¾ÝÒ³”µÄ¸ÅÄîÌ«Éî¿ÌÁË£¬Òò´ËŪÁËÒÔ&ldq ......
Îı¾ nvarchar(n)
±¸×¢ ntext
Êý×Ö(³¤ÕûÐÍ) int
Êý×Ö(ÕûÐÍ) smallint
Êý×Ö(µ¥¾«¶È) real
Êý×Ö(Ë«¾«¶È) float
Êý×Ö(×Ö½Ú) tinyint
»õ±Ò money
ÈÕÆÚ smalldatetime
²¼¶û bit
¸½£º×ª»»³ÉSQLµÄ½Å±¾¡£
ALTER TABLE tb ALTER COLUMN aa Byte Êý×Ö[×Ö½Ú]
ALTER TABLE tb ALTER COLUMN aa Long Êý×Ö[³¤ÕûÐÍ]
ALTER T ......
ÕâÁ½Ì춼ûÓкúÃѧϰ£¬½ñÌìÖÕÓÚËãͶÈëÁËЩ£¬ÓÉÓڿγ̵ĹØÏµ£¬ÎÒµÄsqlÒ²ÊÇͬvbÒ»ÆðѧϰµÄ¡£ËäȻ֪µÀ̰¶à½À²»À㬿ÉÊǰ´ÕÕʵ¼ÊÇé¿ö£¬ÎÒÍêȫûÓÐÀíÓÉÅׯúsqlµÄ¡£
×î½ü¶¼°Ñʱ¼äͶÈëµ½vbºÍÃæÏò¶ÔÏóÖУ¬sql½ñÌìºÃºÃ¸´Ï°ÁËÏ£¬´Ócreate database ¿ªÊ¼£¬create table£¬alter table £¬ add constraint …&h ......
×¢'svw'Ϊ³öÎÊÌâµÄÊý¾Ý¿â,´Ë·½Ê½¶Ôsql7.0ÒÔÉϰ汾ÓÐЧ,ÆäËüµÍ°æ±¾Îª²âÊÔ
sp_configure 'allow',1
go
reconfigure with override
go
update sysdatabases set status=32768 where name='svw'
go
dbcc rebuild_log('svw','D:\mssql7\data ......