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

SQLÓÃDataDiff²éѯµÄ¹ÖÏÖÏó¶øÒý·¢µÄ˼¿¼(2)

ÔÚÄÔ×ÓÀïÀÏÊǼǵõ±³õдSQLµÄʱºò£¬×ÜÊÇÓÐÈËÌáÐѶÔÓÚÖ÷¼üµÄÌõ¼þҪдÔÚÇ°Ã棬ÖÁÓÚΪʲôÏÖÔÚ×ÜÊǼDz»Çå³þÁË¡£µ«ÊÇSQLÖÐwhere Ìõ¼þµÄÖ´ÐÐ˳Ðò¸úÖ÷¼üÒÔ¼°Ë÷ÒýÓкܴóµÄ¹Øϵ¡£
°ÑÉÏƬÖеıía ¼ÓÉÏÖ÷¼ü£º
alter table
add constraint pk_a_id primary key (id)
È»ºóÔÚÔËÐÐÉÏƪÖгö´íµÄÀý¾ä:
select * from a where id in (1,3) and datediff(day, convert(datetime,val),getdate()) < 0
¾¹È»Ã»ÓдíÎ󣬷µ»ØÁËid=1µÄ¼Ç¼¡£¿´À´£¬Èç¹û±íÖÐÓÐÖ÷¼üµÄ»°£¬Ö÷¼ü»á±»ÓÅÏÈÖ´Ðеġ£ËùÒÔ´Ëʱid =2µÄ¼Ç¼¸ù±¾¾Í²»ÔÚ¿¼ÂÇ·¶Î§Ö®ÄÚ¡£
¼ÙÉèÎÒÃDz»¼ÓÖ÷¼ü£¬¶øÊǼÓÉÏÒ»¸öuniqueµÄindex£º
alter table a
drop constraint pk_a_id
create unique index u_a_id on a(id)
È»ºóÔÙÔËÐÐÉÏÃæµÄ¾ä×Ó£º
select * from a where   id in (1,3) and datediff(day, convert(datetime,val),getdate()) < 0
³öÏÖÁË´íÎó£º
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting datetime from character string.
¿É¼ûindex, ²¢²»Äܸıäwhere Ìõ¼þµÄÖ´ÐÐ˳Ðò£¬µ«ÊÇÖ÷¼üÊÇ¿ÉÒԵġ£


Ïà¹ØÎĵµ£º

SQLSERVER SQLÐÔÄÜÓÅ»¯

1.Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)¡¡¡¡
¡¡¡¡ SQLSERVERµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬Òò´Ëfrom×Ó¾äÖÐдÔÚ×îºóµÄ±í£¨»ù´¡±ídriving table£©½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í£¬µ±SQLSERVER´¦Àí¶à¸ö±íʱ£¬»áÔËÓÃÅÅÐò¼°ºÏ²¢µÄ·½Ê½Á ......

ABAP ͨ¹ýSQLÐÞ¸Äij¸ö³ÌÐòµÄËø¶¨×´Ì¬

ÏȰѳÌÐò´ò¿ª,²Ëµ¥ÉÏ Environment/Examples/Performance Examples ÔÚ¿Õ°×´¦ÊäÈë
ÒªÖ´ÐеijÌÐò,×¢ÒâÒ»¶¨ÒªÕýÈ·,·ñÔòºó¹ûºÜÑÏÖØ,ºÇºÇ.
data: itab type table of TRDIR with header line.
select  *  from TRDIR into table itab
where NAME = 'ZHRRPT1011'.
read table itab with key name = 'ZHRRPT1011'.
......

±¸·ÝSQL Server 2005Êý¾Ý¿âµ½Ö¸¶¨Ä¿Â¼µÄSQL½Å±¾

IF EXISTS (SELECT name from master.dbo.sysdatabases WHERE name = N'MyDatabase')
DECLARE @backupdate varchar(255);
DECLARE @result int
DECLARE @result1 int
DECLARE @dbid uniqueidentifier
SET @dbid = NEWID()
EXEC @result = xp_cmdshell 'cd D:\SQLServerBackups';
IF (@result = 1)
EXEC @result1 = ......

PB 11.5Á¬½ÓMS SQL Server 2005 Express

//ÔÚÓ¦ÓóÌÐòOpen ʼþ´úÂëÖÐ
idle(600)
openbakflag=1
///////////////////////¶ÁÈ¡ÅäÖÃÎļþÊý¾Ý¿âÁ¬½ÓÉèÖÃ///////////////////////
string server,datname,datuser,datpsw
server=ProfileString ( "yy.ini","yygl","server", "" )
datname=ProfileString ( "yy.ini","yygl","datname", "" )
datuser=ProfileStrin ......

SQL Server 2005 µÄĬÈÏʵÀýºÍÃüÃûʵÀýµÄÎļþλÖÃ

SQL Server 2005 Áª»ú´ÔÊ飨2008 Äê 11 Ô£©
SQL Server 2005 µÄĬÈÏʵÀýºÍÃüÃûʵÀýµÄÎļþλÖÃ
¸üÐÂÈÕÆÚ£º 2005 Äê 12 Ô 5 ÈÕ
Microsoft SQL Server 2005 µÄ°²×°°üº¬Ò»¸ö»ò¶à¸öµ¥¶ÀµÄʵÀý¡£ÎÞÂÛÊÇĬÈϵĻ¹ÊÇÃüÃûµÄʵÀý£¬¶¼ÓÐ×Ô¼ºµÄÒ»Ì׳ÌÐòÎļþºÍÊý¾ÝÎļþ£¬ÒÔ¼°Ò»Ì×ÔÚ¼ÆËã»úÉϵÄËùÓÐʵÀýÖ®¼ä¹²ÏíµÄ¹«¹²Îļþ¡£
¶ÔÓÚ°üº ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ