两个表的交叉连接

USE [BIMPM_ModelData]
GO

INSERT INTO [dbo].[Model_ItemEFile]
           ([RowGuid]
           ,[ParentRowGuid]
           ,[Title]
           ,[Description]
           ,[Size]
           ,[ExtendName]
           ,[StorageName]
           ,[CreateDate]
           ,[LastModificationDate]
           ,[CreateUserRowGuid]
           ,[CreateUserName]
           ,[FirstVersionRowGuid]
           ,[IsMaxVersion]
           ,[ProjectRowGuid])
     select newID(),p.Number,m.Title,m.Description,m.Size,m.ExtendName,m.StorageName,m.CreateDate,m.LastModificationDate,m.CreateUserRowGuid,m.CreateUserName,m.FirstVersionRowGuid,m.IsMaxVersion,m.ProjectRowGuid
	  from [BIMPM_ModelData].[dbo].[Model_ItemEFile] as m 
  cross join [BIMPM_RoadBridge].[dbo].[ProjectConstructionItemInfo] as p 
  where p.BidSectionRowGuid= '8373de62-4f87-4ca4-b741-30da6491785f-1' and m.ProjectRowGuid = '60ff4b50-2227-4ad2-8950-f7cdab801d6a' and p.Number <>'Z100a#-0'
GO

  

posted @ 2016-10-30 19:02  HongEgg  阅读(348)  评论(0编辑  收藏  举报