002 從別的table,insert到指定table

Post date: 2014/9/16 下午 11:41:09

SELECT

LEN([Text]) as length ,[Text]

FROM [Eggplant].[dbo].[Learning]

ORDER BY

LEN([Text]) DESC

insert into [Eggplant].[dbo].[LearningL] (

[Language]

,[Title]

,[Text]

,[Type]

,[Class]

,[Keyword]

,[Keyword2]

)

select

[Language]

,[Title]

,[Text]

,[Type]

,[Class]

,[Keyword]

,[Keyword2] from

[Eggplant].[dbo].[Learning]

ORDER BY [Language] DESC,[Class] DESC,[Keyword] DESC,[Keyword2] DESC

//----------------------------------------------

SELECT

LEN([LogNo]) as length ,[LogNo]

FROM [LearningKing].[dbo].[UpdateListss]

ORDER BY

LEN([LogNo]) DESC

insert into [LearningKing].[dbo].[UpdateLists] (

[UpdateDate]

,[UpdateName]

,[UpdateStatus]

,[TotalFiles]

,[FinishFiles]

,[Percentage]

,[StartTime]

,[EndTime]

,[UpdateType]

,[CourseID]

,[VideoID]

,[PageNo]

,[DisplayName]

,[FileName]

,[GroupID]

,[VersionID]

,[VerDataY]

,[VerDataB]

,[VerDataS]

,[VerDataN]

,[VerDataP]

,[ExamQty]

,[SysLogDate]

)

select

[UpdateDate]

,[UpdateName]

,[UpdateStatus]

,[TotalFiles]

,[FinishFiles]

,[Percentage]

,[StartTime]

,[EndTime]

,[UpdateType]

,[CourseID]

,[VideoID]

,[PageNo]

,[DisplayName]

,[FileName]

,[GroupID]

,[VersionID]

,[VerDataY]

,[VerDataB]

,[VerDataS]

,[VerDataN]

,[VerDataP]

,[ExamQty]

,[SysLogDate]

from

[LearningKing].[dbo].[UpdateListss]

ORDER BY [UpdateDate] asc