sqlserverÖÐÅúÁ¿Ð޸ĶÔÏóËùÓÐÕß
ÒÔ³¬¼¶¹ÜÀíÔ±µÇ¼ϵͳ£¬È»ºóÖ´ÐÐÒÔϽű¾¾Í¿ÉÒÔÅúÁ¿Ð޸ĶÔÏóËùÓÐÕß¡£
sp_configure 'allow updates','1'
go
reconfigure with override
go
update sysobjects set uid=1 where uid<>1
go
sp_configure 'allow updates','0'
go
reconfigure with override
Ïà¹ØÎĵµ£º
ms sqlserver 2005ÖеĴ洢¹ý³ÌÎÞ·¨ÔÚManagement StudioÖнøÐе÷ÊÔ£¬
µ«¿ÉÒÔͨ¹ýVisual Studio 2005À´¶ÔÖ®½øÐе÷ÊÔ¡££¨¿ÉÉèÖöϵ㣬µ¥²½µ÷ÊԵȣ©
²ÉÓÃVisual Studioµ÷ÊÔ´æ´¢¹ý³ÌµÄ·½·¨ÈçÏ£º
1.Æô¶¯Visual Studio£¨¿É²»´´½¨ÏîÄ¿£©£¬´ò¿ªServer Explorer£¨²Ëµ¥£view-Server Explorer)
......
<Language from="SQL" To="C#">
<Type from="bigint" To="long" />
<Type from="binary" To="object" />
<Type from="bit" To="bool" />
<Type from="char" To="string" />
<Type from="datetime" To="DateTime" ......
ÔÚÁÙʱ±í
create table #T (…)
ºÍ±í±äÁ¿
declare @T table (…)
Ö®¼äÖ÷ÒªÓÐ3¸öÀíÂÛÉϵIJ»Í¬¡£
µÚÒ»¸ö²»Í¬Ê¹ÊÂÎñÈÕÖ¾²»»á¼Ç¼±í±äÁ¿¡£Òò´Ë£¬ËüÃÇÍÑÀëÁËÊÂÎñ»úÖƵķ¶Î§£¬´ÓÏÂÃæµÄÀý×Ó¿ÉÏÔ¶øÒ×¼û£º
create table #T (s varchar(128))
declare @T table (s varchar(128))
insert into #T select 'old va ......
¡¡È·Êµ£¬Êý¾Ý¿âµÄά»¤³£³£½»¸øÄÇЩרҵµÄÊý¾Ý¿â¹ÜÀíÔ±£¬µ«ÊÇ×÷Ϊһ¸ö¿ª·¢Õߣ¬ÄãÒ²Ðíż¶ûÐèÒªÔÝʱ´ÓÊÂÕâ¸ö¹¤×÷¡£ËùÒÔ£¬ÊÔÒ»ÊÔÕâÁ½¸öSQL·þÎñÆ÷ά»¤¼¼ÇÉ£ºÇáËɸıäÊý¾Ý¿âÓµÓÐÕß¡¢ÕûÀíË÷ÒýËéƬ¡£Ë»áÏëµ½ÄãÉõÖÁ¿ÉÒÔ¸øÄÇЩÊý¾Ý¿â¹ÜÀíÔ±½ÌÉÏÒ»Á½¸öм¼ÇÉÄØ£¿ÖØÖ¸¶¨Êý¾Ý¿âÓµÓÐÕßµ±»Ø¸´»òÕßн¨Êý¾Ý¿âʱ£¬ÄãÓÐûÓÐ×¢Òâµ½SQL Server° ......
use tempdb
go
if (object_id ('t1' ) is not null ) drop table t1
if (object_id ('t2' ) is not null ) drop table t2
go
create table t1 (a int )
insert into t1 select 1 union select 2 union select 3
create table t2 (a int )
insert into t2 select 3 union select 4 union select 5
go
sele ......