Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQLλÔËËã

SQLλÔËËã
select 2|8       --10
select 2|8|1    --11
select 10&8    --8,°üº¬,10=8+2
select 10&2    --2,°üº¬,10=2+8
select 10&4    --0,²»°üº¬
select 19&16  --16,°üº¬,19=16+2+1
select 19&8    --0,°üº¬,19=16+2+1
select * from SqlBitOperation where FBitTags&4=4
 
ÔÚȨÏÞÖеÄÓ¦ÓÃ
1¡¢Á½Õűí
£¨1£©¡¢²Ù×÷ÓëȨÏÞ±êÖ¾±í
if exists (select * from sysobjects where id = OBJECT_ID('[RightTags]') and OBJECTPROPERTY(id, 'IsUserTable') = 1)
DROP TABLE [RightTags]
CREATE TABLE [RightTags] (
[Pkid] [int]  IDENTITY (1, 1)  NOT NULL,
[RightsName] [nvarchar]  (50) NOT NULL,
[RightsTag] [int]  NOT NULL DEFAULT (0))
ALTER TABLE [RightTags] WITH NOCHECK ADD  CONSTRAINT [PK_RightTags] PRIMARY KEY  NONCLUSTERED ( [Pkid] )
SET IDENTITY_INSERT [RightTags] ON
INSERT [RightTags] ([Pkid],[RightsName],[RightsTag]) VALUES ( 1,'³Ô·¹',1)
INSERT [RightTags] ([Pkid],[RightsName],[RightsTag]) VALUES ( 2,'À­Êº',2)
INSERT [RightTags] ([Pkid],[RightsName],[RightsTag]) VALUES ( 3,'´òÅÚ',4)
INSERT [RightTags] ([Pkid],[RightsName],[RightsTag]) VALUES ( 4,'ÅÝæ¤',8)
INSERT [RightTags] ([Pkid],[RightsName],[RightsTag]) VALUES ( 5,'Éú×Ó',16)
INSERT [RightTags] ([Pkid],[RightsName],[RightsTag]) VALUES ( 6,'°ü¶þÄÌ',32)
SET IDENTITY_INSERT [RightTags] OFF

£¨2£©¡¢Óû§ÓëȨÏÞ±í
if exists (select * from sysobjects where id = OBJECT_ID('[RightUsers]') and OBJECTPROPERTY(id, 'IsUserTable') = 1)
DROP TABLE [RightUsers]
CREATE TABLE [RightUsers] (
[Pkid] [int]  IDENTITY (1, 1)  NOT NULL,
[FUser] [nvarchar]  (50) NOT NULL,
[UserRights] [int]  NOT NULL DEFAULT (0))
ALTER TABLE [RightUsers] WITH NOCHECK ADD  CONSTRAINT [PK_RightUsers] PRIMARY KEY  NONCLUSTERED ( [Pkid] )
SET IDENTITY_INSERT [RightUsers] ON
INSERT [RightUsers] ([Pkid],[FUser],[UserRights]) VALUES ( 1


Ïà¹ØÎĵµ£º

SQLʱ¼äº¯Êý


Sqlʱ¼äº¯Êý
Ò»¡¢sql serverÈÕÆÚʱ¼äº¯Êý
Sql ServerÖеÄÈÕÆÚÓëʱ¼äº¯Êý 
1.  µ±Ç°ÏµÍ³ÈÕÆÚ¡¢Ê±¼ä 
    select getdate()  
2. dateadd  ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØеĠdatetime Öµ
    ......

sql xml ÈëÃÅ

*
sql xml ÈëÃÅ:
    --by jinjazz
    --http://blog.csdn.net/jinjazz
   
    1¡¢xml:        ÄÜÈÏʶԪËØ¡¢ÊôÐÔºÍÖµ
   
    2¡¢xpath:    Ñ°Ö·ÓïÑÔ£¬ÀàËÆwind ......

sql serverºÍoracleÐÐתÁеÄÒ»ÖÖµäÐÍ·½·¨

sql serverºÍoracleÐÐתÁеÄÒ»ÖÖµäÐÍ·½·¨
Ç°ÑÔ£ºÍøÉÏÓв»ÉÙÎÄÕÂÊǽ²ÐÐתÁеģ¬µ«ÊǴ󲿷ֶ¼ÊÇÖ±½ÓÌù´úÂ룬ºöÊÓÁËÖмä¹ý³Ì£¬±¾ÈË×Ô¼ºË¼¿¼ÁËÏÂΪʲôҪÕâÑùʵÏÖ£¬²¢ÇÒ×öÁËÈçϵıʼǣ¬¶ÔÓÐЩ¶®µÄÈËÀ´Ëµ¿ÉÄÜûÓмÛÖµ£¬Ï£Íû¶Ô»¹²»¶®µÄÈËÓÐÒ»µã½è¼øÒâÒå¡£
¶ÔÓÚÓÐЩҵÎñÀ´Ëµ£¬Êý¾ÝÔÚ±íÖеĴ洢ºÍÆä×îÖÕµÄGrid±íÏÖÇ¡ºÃÏ൱ÓÚ°ÑÔ ......

SQLÖÐÈçºÎÓÃÒ»¸ö±í¸üÐÂÁíÒ»¸ö±í

for ACCESS :
update a, b set a.name=b.name1 where a.id=b.id
for SQL Server:
"update a set a.name=b.name1 from a,b where a.id=b.id"
update   a   set   a.status=b.status  
  from   table1   a,table2   b  
&nbs ......

SQL Mirror HA(SQL serverµÄ¸ß¿ÉÓÃÐÔ)[תÔØ]


¶ÔSQL Server 2008 ½øÐÐMirrorµÄ»ù±¾ÅäÖü°°²×°¡£
×¼±¸¹¤×÷
1. Principal ÓëMirror ÒÔ¼° Witness Èý̨ʵÀý¶¼°²×°ÎªÏàͬ°æ±¾£¬Ä¿Ç°Êǵ½SQL Server 2008 SP1¡£
2. ÐèÒªÓÐÒ»¸öÓòÕÊ»§·Ö±ðÌí¼Óµ½ Èý̨Êý¾Ý¿âʵÀýËùÔÚµÄServer µÄ Administrators×é¡¢ÒÔ¼°SQL Server Ïà¹ØµÄ×éÖУ» ÓÉÓÚ¾ßÌåµÄ×éµÄ¹¦Äܲ»Çå³þ£¬Òò´Ë½¨ÒéËùÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ