复制一行行,获取一个值:日期.必须是System.DateTime.now
我需要将一个表的行复制到另一个表,除了一个值:logdate
未从任何行中选择logdate值,它必须是NOW日期和时间.
我不知道使它工作的语法?
这是我的SQL:
插入日志文件表(文件名,文件类型,文件列,FK更新,父纤维FK,日志日期)logdate = Systen.DateTime.Now
SELECT filename,filetype,filecolumn,lasteditbyFK,parentfiberFK FROM filetable,其中filename ="sorteringstest",parentfiberFK = 6,文件类型<> ''.pdf''
i need to Copy a row exept from one table to another, except for one value: logdate
The logdate value is not selected from any row, it has to be the NOW date and time.
i dont know the syntax to make it work?
this is my sql:
INSERT logfiletable(filename,filetype,filecolomn,lastupdatebyFK,parentfiberFK,logdate)logdate=Systen.DateTime.Now
SELECT filename,filetype,filecolumn,lasteditbyFK,parentfiberFK FROM filetable where filename =''sorteringstest'' and parentfiberFK= 6 and filetype <> ''.pdf''
您不能在SQL中使用System.DateTime.Now.您必须改用SQL函数getdate.
You can''t use System.DateTime.Now in SQL. You would have to use the SQL function getdate instead.
类似以下内容:
Something like this:
INSERT INTO logfiletable(filename,filetype,filecolomn,lastupdatebyFK,parentfiberFK,logdate)
SELECT filename,filetype,filecolumn,lasteditbyFK,parentfiberFK, GetDate() FROM filetable where filename =''sorteringstest'' and parentfiberFK= 6 and filetype <> ''.pdf''