¾¡Á¿²»ÒªÆ´´ÕSqlÓï¾ä,ÓòÎÊýÀ´·À×¢Èë
Èç¹ûÊÇÀàËÆ"select * from user where uid="+uid +" and pwd="+pwd ºÜÈÝÒ׳öÎÊÌâ
ʹÓà SQLParamenter
°ÑÄãµÄSQLÓï¾äд³É ÀàËÆ´æ´¢¹ý³Ì
select * from user where uid=@uid and pwd=@pwd
ʹÓÃÕâ¸öSQLÓï¾ä¶¨ÒåΪ SQLCommand ¶ÔÏó È»ºóʹÓà Paramenter ¶ÔÏó°Ñ @*** Ìæ»»Îª Öµ
¾Í¿ÉÒԸ㶨עÈëʽ©¶´ÁË
Ïà¹ØÎĵµ£º
sql DATEPARTº¯ÊýʹÓÃ(Õª³)
sql DATEPARTº¯ÊýʹÓÃ
DATEPART
·µ»Ø´ú±íÖ¸¶¨ÈÕÆÚµÄÖ¸¶¨ÈÕÆÚ²¿·ÖµÄÕûÊý¡£
Óï·¨
DATEPART ( datepart ,date )
²ÎÊý
datepart
ÊÇÖ¸¶¨Ó¦·µ»ØµÄÈÕÆÚ²¿·ÖµÄ²ÎÊý¡£Ï±íÁгöÁË Microsoft® SQL Server™ ʶ±ðµÄÈÕÆÚ²¿·ÖºÍËõд¡£
ÈÕÆÚ²¿·ÖËõд
year
yy, yyyy
quarter
qq, q
mont ......
Sql server2005ÓÅ»¯²éѯËÙ¶È51·¨²éѯËÙ¶ÈÂýµÄÔÒòºÜ¶à£¬³£¼ûÈçϼ¸ÖÖ£¬´ó¼Ò¿ÉÒԲο¼Ï¡£
I/OÍÌÍÂÁ¿Ð¡£¬ÐγÉÁËÆ¿¾±Ð§Ó¦¡£
¡¡¡¡Ã»Óд´½¨¼ÆËãÁе¼Ö²éѯ²»ÓÅ»¯¡£
¡¡¡¡ÄÚ´æ²»×ã¡£
¡¡¡¡ÍøÂçËÙ¶ÈÂý¡£
¡¡¡¡²éѯ³öµÄÊý¾ÝÁ¿¹ý´ó(¿ÉÒÔ²ÉÓöà´Î²éѯ£¬ÆäËûµÄ·½·¨½µµÍÊý¾ÝÁ¿)¡£
¡¡¡¡Ëø»òÕßËÀËø(ÕâÒ²ÊDzéѯÂý×î³£¼ûµÄÎÊÌ ......
Êýѧº¯Êý
1.¾ø¶ÔÖµ
S:select abs(-1) value
O:select abs(-1) value from dual
2.È¡Õû(´ó)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.È¡Õû£¨Ð¡£©
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.È¡Õû£¨½ØÈ¡£©
S:select cast(-1.002 as in ......
USE master
GO
CREATE DATABASE testbase2
ON
PRIMARY
(NAME = prim_sub_dat1,
FILENAME = 'G:\SQL SERVER2000\prim_sub_dat.mdf',
SIZE = 5MB,
MAXSIZE = 50MB,
FILEGROWTH = 20%),
(NAME = prim_sub_dat2,
FILENAME = 'G:\SQL SERVER2000\prim_sub_dat.ndf'
SIZE = 5MB,
MAXSIZE = 50MB,
......