DatetimeÏÔʾ·½Ê½SQLServer
½ñÌìÔÚдÊÓͼʱ£¬Óöµ½Òª°ÑDatetimeÀàÐÍתVarcharÀàÐÍ¡£ÒÔÇ°ÔÚORALCE¾ÍÈÝÒ×£¬Ö±½ÓToChar(getdate(),'yyyy-mm-dd')¡£ÔÚSQL Server 2005
select CONVERT(varchar, getdate(), 120 )
2004-09-12 11:06:08
select CONVERT(varchar(12) , getdate(), 111 )
2004/09/12
select CONVERT(varchar(12) , getdate(), 112 )
20040912
select CONVERT(varchar(12) , getdate(), 102 )
2004.09.12
select CONVERT(varchar(12) , getdate(), 101 )
09/12/2004
select CONVERT(varchar(12) , getdate(), 103 )
12/09/2004
select CONVERT(varchar(12) , getdate(), 104 )
12.09.2004
select CONVERT(varchar(12) , getdate(), 105 )
12-09-2004
select CONVERT(varchar(12) , getdate(), 106 )
12 09 2004
select CONVERT(varchar(12) , getdate(), 107 )
09 12, 2004
select CONVERT(varchar(12) , getdate(), 108 )
11:06:08
select CONVERT(varchar(12) , getdate(), 109 )
09 12 2004 1
select CONVERT(varchar(12) , getdate(), 110 )
09-12-2004
select CONVERT(varchar(12) , getdate(), 113 )
12 09 2004 1
select CONVERT(varchar(12) , getdate(), 114 )
11:06:08.177
Ïà¹ØÎĵµ£º
package cn.ctgu.edu.ac;
import java.sql.*;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String url="jdbc:sqlserver://localhost:1433;Database=ÍøÉÏÊéµê¹ÜÀíϵͳ;integr ......
ÊÀʶ´Ã÷½ÔѧÎÊ£¬ÈËÇéÁ·´ï¼´ÎÄÕ¡£×öASPʱ£¬×î³£ÓõÄÊý¾Ý¿â¼´SqlserverÓëAccessÊý¾Ý¿âĪÊôÁË£¡
µ«Ê¹Óûᾳ£·¢ÏֺܶàSQLÖ´ÐеÄÎÊÌâ¡£ÕâÀïÕûÀí³öÖ®¼äµÄ²îÒ죬×ö¸öÊ®´ó²îÒìµÄ×ܽᡣ
ACCESS½á¹¹¼òµ¥ÈÝÒ×´¦Àí£¬¶øÇÒÒ²ÄÜÂú×ã¶àÊýµÄÍøÕ¾³ÌÐòÒªÇó£¬Ò²ÊdzõѧÕßµÄÊÔÅ£µ¶¡£
ACCESSÊÇСÐÍÊý¾Ý¿â£¬¼ÈÈ»ÊÇСÐ;ÍÓÐËû¸ù±¾µÄ¾ÖÏÞÐÔ£º
......
ÊÂÎñµÄ¹¦ÄÜÔÚsqlserverÖÐÓÉÀ´ÒѾã¬ÒòΪ×î½üÔÚ×öÒ»¸öÊý¾Ýͬ²½·½°¸£¬ËùÒÔÓлú»áÔÙ´ÎÑо¿Ò»ÏÂËüÒÔ¼°¿ìÕյȣ¬·¢ÏÖ»¹ÊÇÓкܶ಻´íµÄ¹¦Äܺ͸ĽøµÄ¡£ÕâÀïÒÔsqlserver2008µÄÊÂÎñ·¢²¼¹¦ÄÜΪÀý£¬¶Ô·¢²¼¶©Ôĵķ½Ê½¼òÒª½éÉÜһϲÙ×÷Á÷³Ì£¬Ò»·½Ãæ×ö¸ö×ܽᱸ·Ý£¬Ò»·½ÃæÓë´ó¼Ò½øÐÐһϷÖÏíºÍ½»Á÷¡£·Ñ»°¾Í² ......
ÍÐÁ˼¸ÌìµÄÄÑÌ⣬ÖÕÓÚ½â¾öÁË¡£ÌØ·ÖÏíÒ»ÏÂ
ÒÔÏÂÊÇÒ»¸ö´æ´¢¹ý³Ì
CREATE PROCEDURE deleteAccountAll
@id int
AS
SET XACT_abort ON
BEGIN DISTRIBUTED TRAN
delete from AccountCapital where accountid = @id
delete from logininfo where username = @id
delete from CapitalRecord where accountid ......
ÓÃwindowsÕ˺Ż¹ÊÇ¿ÉÒԵǼµÄ¡£
²éÕÒÎÊÌâµÄ¹ý³Ì£º
µÚÒ»²½£º Æô¶¯ËùÓÐÓëSQLÓйصķþÎñ£¬ÎÊÌâÒÀ¾É£»
µÚ¶þ²½£º ²é¿´windows·À»ðǽ£¬±»Ä¬ÈÏÆô¶¯ÁË£¬²»Æô¶¯Ñ¡ÔñÏî±»Disabled¡£Á½¸öÌáʾ“ÓÉÓÚ°²È«¿¼ÂÇ,ijЩÉèÖÃÓÉ×é²ßÂÔ¿ØÖÆ”“Windows·À»ðǽÕýÔÚʹÓÃÄúµÄÓòÉèÖÔ£¬ÏÈÓÃgpedit.msc´ò×é²ßÂÔ±à¼Æ÷£¬»úËã»úÅ ......