È¡sqlserverϵͳʱ¼ä
¸÷λ´óϺÃÇ
sqlserverÔõôȡµ½ÕâÑù¸ñʽµÄÈÕÆÚ°¡£¿
20100223£¬²»Òª2010-02-23ÕâÑùµÄ
лл
SQL code:
select convert(varchar(10),getdate(),112)
----------
20100223
(1 ÐÐÊÜÓ°Ïì)
SQL code:
select convert(varchar(10),getdate(),112)
SQL code:
select convert(varchar(8),getdate(),112)
ÖîλÕæ¿ì£¬Ð»Ð»¡£¡£¡£
SQL code:
select convert(varchar(10),getdate(),112) as ϵͳʱ¼ä
ϵͳʱ¼ä
----------
20100223
(1 ÐÐÊÜÓ°Ïì)
Ïà¹ØÎÊ´ð£º
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class QueryTest&n ......
´ÓÍøÉϲ鵽µÄ×ÊÁÏ˵£¬ÈκÎÊý¾ÝÀàÐÍÓëNULLÖµ½øÐмÆË㣬½á¹û¶¼½«ÎªNULL.
select null-1
½á¹ûÊÇnull
¿ÉÊÇÏÂÃæÕâ¸ö²éѯΪʲô»á³ö´íÄØ£¿
select isnull(null-1,'test');
¾ÓÈ»±¨´í˵½«varcharתΪintʧ°Ü¡£
Ϊʲô» ......
asp.net²éѯSqlServer2005ÖÐtextÀàÐÍÊý¾Ý³£³£¶ªÊ§£¬Ìí¼ÓÊý¾Ýµ½textÀàÐÍÖп´Ò³ÃæÉÏ¿ÉÒÔ£¬ÓиöÒ»Á½Ì죬¾Í¿ÉÄÜ»á³öÏÖtext
Êý¾Ý´æµÄÊý¾ÝȱÉÙÒ»²¿·Ö£¬ÎªÊ²Ã´°¡£¡Çë´ó¼Ò°ï°ïæ°¡£¡
Óöþ½øÖÆ´æ·ÅËãÁË
²»Ã÷°×£¬ÄÜ×Ðϸ ......
ÓÐһ̨Êý¾Ý¿â·þÎñÆ÷£¬¿Í»§¶ËʹÓÃADO.NETÁ¬½Ósql£¬Ê¹ÓÃExecuteScalarÖ´ÐÐSQL INSERTÓï¾ä£¬È»ºó¿Í»§¶Ëˢв»Äܲéѯµ½ÐÂINSERTµÄÊý¾Ý£¬¹ý10Ãë×óÓÒ²ÅÄܲ鵽ÐÂÊý¾Ý
ʲôÔÒò
Äã×öÁË»º´æÂð£¿
û×ö»º´æ
Ôõô»áÄØ£¡ ......
ûÁ¬½ÓÍøÏߣ¬ÎÒÔÚ±¾»úÉÏ°²×°µÄsqlserver2008¾Í½ø²»È¥ÁË¡£Ôõô½â¾öÄØ£¿
±¾µØ²»ÄܵǼÂð£¿.......
ÒýÓÃ
±¾µØ²»ÄܵǼÂð£¿.......
ÊǵÄÊǵÄÊǵÄÊǵÄÊǵÄÊǵÄÊǵÄÊǵÄ
Óà windowsÉí·ÝÒ²²»ÄܵǼÂð£¿
ÄãÁ¬½Óµ ......