在IMS数据库创建视图,替代原来的表,视图代码如下:
CREATE VIEW [dbo].[T1511I1817125b457]
AS
SELECT distinct convert(int,row_number()over(order by FV151118861716a42)) as id,a.* from(select 61 DirID,convert(tinyint,'0') SecLevel,convert(nvarchar(255),'admin') Builder,CONVERT(DATETIME, GETDATE(),120) LastModified,
convert(nvarchar(255),'admin') LastMender,
convert(nvarchar,t.username) as F151p113181P71519,convert(nvarchar,t.email) F1511181b987N1534,CONVERT(DATETIME,t.createdate,120) F1Od5113318171545,
CONVERT(DATETIME,t.lastlogindate,120) F1F595d1118171554,CONVERT(DATETIME,t.lastpasswordchangeddate,120) F151114K5817s1619,CONVERT(DATETIME,case when t.lastlockoutdate='1754-01-01 00:00:00.000' then null else t.lastlockoutdate end,120) F151118171hE1630,
CONVERT(DATETIME,t.lastactivitydate,120) FV151118861716a42,convert(nvarchar,t4.unitname) F138511B18171h655,
convert(nvarchar(100),t.userid) as F151123u157B84011,t5.islockedout as F15b121L166350
FROM [portal_db].[dbo].vw_aspnet_membershipusers t
INNER JOIN [portal].[dbo].userexinfo t3 ON t3.username = t.username
INNER JOIN [portal].[dbo].units t4 ON t4.iD = t3.unitID
inner join [portal_db].[dbo].aspnet_membership t5 on t5.userid=t.userid
)a