快照

Create dataBase UserInfo2_Shap
on
(
Name=MySql,fileName='D:\UserInfo2.mdf'
)
as SnapShot of MySql


select * from UserInfo

Create Proc p_UserInfo
(
@ShapName nvarchar(50),
@SqlStrl Text
)

 

/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [ID]
,[Name]
,[Age]
,[Sex]
FROM [MySql].[dbo].[UserInfo]


exec p_UserInfo @ShapName='UserInfo_Shap',@SqlStrl=''
alter Proc p_UserInfo
(
@ShapName nvarchar(50),
@SqlStrl Text
)
as
begin
exec('select * from '+@ShapName+'.dbo.UserInfo')
end



你可能感兴趣的:(快照)