sqlserver 2005 ¹ØÓÚÈÕÆÚ¸ñʽ
±ÈÈç ´«½øÀ´µÄ×Ö·û´®ÊÇ ¡®12/sep/2009 12£º52£º20¡¯ Ö±½ÓÓÃcast»á±¨´í¡£
¶øÇÒÖмäµÄÔ·ÝÒ²²»¹Ì¶¨ ¡£Ôõôת»»³ÉÈÕÆÚÐ͵ÄÄØ
ÓÃÒ»¸ö±í¼Ç¼1-12Ô·ݣ¡
Ö±½Óת»»ÊDz»ÐÐÁË ²ð·Ö ³öÔÂÀ´ÅжÏÁË
¡®12/sep/2009 12£º52£º20¡¯ÊÇͨ¹ýº¯ÊýÈ¡µÃµÄ°É
ÎÒµÄÒ»°ã×ö·¨ÊÇ°ÑÊý¾Ý¿âÀï´æ³É×Ö·û´®ÀàÐÍ£¬È»ºó·Ö±ðÈ¡µÃÄêÔÂÈÕ£¨µ±È»ÄãÈç¹ûÐèÒª»¹¿ÉÒÔÈ¡µ½¾ßÌåʱ¼ä£¬ÕâÓóÌÐòºÜÈÝÒ×ʵÏÖ£©
È»ºóÔÚÊý¾Ý¿âÀï´æ·Å¹Ì¶¨¸ñʽ£¬±ÈÈç2009/9/12,ÕâÑùÈ¡Êý¾ÝÒ²ºÃÈ¡°¡
²»ÖªµÀ¶ÔÄãÓÐûÓÐÓÃ
Ô·ÝÊÇÓ¢ÎĵÄsql server ²»Ê¶±ð
Óà replace()º¯Êý°ÑÔ·ÝÌæ»»³ÉÊý×Ö
SQL code:
if object_id('tb') is not null drop table tb
go
create table tb(yf nvarchar(10),en nvarchar(10),sm nvarchar(10))
go
insert tb
select '01','January','Ò»Ô·ݣ½JAN'
union all select '02','February','¶þÔ·ݣ½FEB'
union all select '03','March','Ò»Ô·ݣ½JAN'
union all select '04','April','ÈýÔ·ݣ½MAR'
union all select '05','May','ÎåÔ·ݣ½MAY'
union all select '06','June','ÁùÔ·ݣ½JUN'
union all select '07','July','ÆßÔ·ݣ½JUL'
union all select '08','August','°ËÔ·ݣ½AUG'
union all select '09','September','¾ÅÔ·ݣ½SEP'
union all select '10','October','ʮԷݣ½OCT'
union all select '11','November','ʮһÔ·ݣ½NOV'
union all select '12','December','Ê®¶þÔ·ݣ½DEC'
select * from tb
select convert(datetime,'12/'+(select yf from tb where en like '%sep%')+'/2009 12:52:20',120)
--2
Ïà¹ØÎÊ´ð£º
´úÂ룺
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con= DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost: ......
ÎÒµÄÊý¾Ý¿âÊǼòÌåsqlserver2000 ,ÎÒÏëÔÚ·±ÌåaccessÏÂÁ¬½Ó,ͨ¹ýodbcÊÇ¿ÉÒÔÁË,µ«ÔÚaccessϳöÏÖ´ò¿ªµÄ±íÈ«ÖÐ"#ÒÑɾ³ý"
²»ÖªµÀÒªÔõô²Ù×÷²Å¿ÉÒÔÓÃACCESS·±ÌåÁ¬½Ó¼òÌåsqlserver2000.лл!!!
´ó¼Ò¶¼ ......
SQL code:
begin tran
update EB with(rowlock) set Name='abc123' where Code=12 waitfor delay '00:00:13'
commit tran
ÎÒÓÃrowlockÏëËø¶¨Ò»ÐУ¬¿ÉÊÇËü°ÑÕû¸ö±í¶¼Ëø¶¨ÁË¡£²»¹ÜÎÒ¸üÐÂÄÄÒ»ÌõÊý¾Ý¶¼ ......
»¹ÔµÄ±¨´íÐÅÏ¢:
System.Data.SqlClient.SqlError: ±¸·Ý¼¯ÖеÄÊý¾Ý¿â±¸·ÝÓëÏÖÓÐµÄ 'chat_Data' Êý¾Ý¿â²»Í¬¡£ (Microsoft.SqlServer.Smo)
Çë¸÷λ¸ßÊÖ°ïæ½â¾ö
»¹ÔµÄÊý¾Ý¿âÃû×ÖÓ뱸·ÝµÄÊ ......
ÇëÎÊһϣ¬ÍâÍøÁ½Ì¨SQLSERVERʵÀýÊý¾Ý´«Ê䣬ÓÐûÓвÉÓÃÊý¾ÝѹËõºÍ¼ÓÃÜ¡£Ñ¹Ëõ±ÈÊǶàÉÙ£¬¼ÓÃÜÊÇʲô¼ÓÃÜËã·¨£¿Ïà¹ØÎĵµÄÄÀï¿ÉÒÔÕÒµ½£¿Ð»Ð»
ÎÒÒ²ÏëÖªµÀ£¡¹Ø×¢´ËÌù£¡
¹Ø×¢¡«¡«
Êý¾Ý¿â´óÅ£¶¼ÄÄÈ¥ÁË°¡£¿
......