¿É½«Ò»¸ö±íµÄËùÓÐÊý¾Ýµ¼³ÉinsertµÄsqlÓï¾ä£´æ´¢¹ý³Ì
CREATE PROCEDURE dbo.OutputData
@tablename varchar(200)
AS
declare @column varchar(1000)
declare @columndata varchar(1000)
declare @sql varchar(4000)
declare @xtype tinyint
declare @name sysname
declare @objectId int
declare @objectname sysname
declare @ident int
set nocount on
set @objectId=object_id(@tablename)
if @objectId is null -- Åж϶ÔÏóÊÇ·ñ´æÔÚ
begin
print @tablename + '¶ÔÏó²»´æÔÚ'
return
end
set @objectname=rtrim(object_name(@objectId))
if @objectname is null or charindex(@objectname,@tablename)=0
begin
print @tablename + '¶ÔÏó²»ÔÚµ±Ç°Êý¾Ý¿âÖÐ'
return
end
if OBJECTPROPERTY(@objectId,'IsTable') < > 1
Ïà¹ØÎĵµ£º
HibernateÊÇÒ»¿îÓÅÐãµÄORM¹¤¾ß¡£µ«ÊÇÔÚijЩÇé¿öÏÂÄÑÃâ»á¸øÎÒÃǵÄÏîÄ¿´øÀ´Ò»¶¨µÄ¸´ÔÓÐÔ¡£¾ÍËãʹÓÃspring×öÒ»¶¨µÄÊÂÎñ¼ò»¯£¬¸Ä±äµÄÒ²½ö½öÊDZàдµÄʱºò¸ü¼ÓµÄ¼òµ¥¶øÒÑ¡£ÌرðÊÇÔÚ´¦Àí²éѯµÄʱºò£¬hibernateºÍsql±È½ÏÆðÀ´£¬¾ÍËƺõûÓÐÄÇô´óµÄÓÅÊÆÁË¡£ËùÒÔÔںܶàµÄÏîÄ¿ÀïÃæÔÚʹÓÃhibernateºÍspringµÄͬʱ»¹»áʹÓÃibatisµÄsqlmap¡ ......
·µ»Ø´ú±íÖ¸¶¨ÈÕÆÚµÄÖ¸¶¨ÈÕÆÚ²¿·ÖµÄÕûÊý¡£
Óï·¨
DATEPART ( datepart ,date )
²ÎÊý
datepart
ÊÇÖ¸¶¨Ó¦·µ»ØµÄÈÕÆÚ²¿·ÖµÄ²ÎÊý¡£Ï±íÁгöÁË Microsoft® SQL Server™ ʶ±ðµÄÈÕÆÚ²¿·ÖºÍËõд¡£
ÈÕÆÚ²¿·ÖËõд
year
yy, yyyy
quarter
qq, q
month
mm, m
dayofyear
dy, y
day
dd, d
week
wk, ww
weekda ......
http://www.oreilly.com/catalog/artofsql £¨ÔÊ飩
http://www.oreilly.com.cn/book.php?bn=978-7-121-05834-9 (ÖÐÎÄ°æ)
Êý¾Ý¿â¼¼ÊõÊÇÆóÒµÐÅÏ¢»¯¿ª·¢µÄ»ù´¡¡£ÔÚÖÆÔìÒµÐÅÏ¢»¯ÁìÓò´ÓÒµ¶àÄ꣬×Ô¼º¶ÔÕâ¿é֪ʶȴһֱÁãËéÔÓÂÒ£¬Ó¦¸ÃÀí˳˼·£¬Îª¼Ü¹¹Éè¼ÆµÄÄ¿±ê½¨Á¢»ù´¡¡£
´ËÊé ......
sqlºËÐÄÓï¾ä(·Ç³£ÊµÓõļ¸¸ö¼¼ÇÉ)²åÈëÊý¾Ý
Ïò±íÖÐÌí¼ÓÒ»¸öмǼ£¬ÄãҪʹÓà sql INSERT Óï¾ä¡£ÕâÀïÓÐÒ»¸öÈçºÎʹÓÃÕâÖÖÓï¾äµÄÀý×Ó£º
INSERT mytable (mycolumn ......