File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change 1818EXEC MySampleSP;
1919
2020
21- -- ! Often must have ANSI_NULLS ON to create a cloned SP.
22- SET ANSI_NULLS ON ;
2321
24- EXECUTE CloneSP
25- @source_name = ' [dbo].[MySampleSP]' ,
26- @target_name = ' [dbo].[MyClonedSP]' ,
22+ -- Checking for existing of a target linked-server.
23+ -- IF EXISTS(SELECT * FROM sys.servers WHERE name = N'Replaced_alias__Other_linked_server')
24+ -- BEGIN
2725
28- @sub1_from = ' Server_level_alias__Linked_server' ,
29- @sub1_to = ' Replaced_alias__Other_linked_server' ,
26+ -- ! Often must have ANSI_NULLS ON to create a cloned SP.
27+ SET ANSI_NULLS ON ;
3028
31- @sub2_from = ' MySampleSP' ,
32- @sub2_to = ' MyClonedSP'
33- ;
29+ EXECUTE CloneSP
30+ @source_name = ' [dbo].[MySampleSP]' ,
31+ @target_name = ' [dbo].[MyClonedSP]' ,
3432
33+ @sub1_from = ' Server_level_alias__Linked_server' ,
34+ @sub1_to = ' Replaced_alias__Other_linked_server' ,
3535
36- EXEC MyClonedSP;
36+ @sub2_from = ' MySampleSP' ,
37+ @sub2_to = ' MyClonedSP'
38+ ;
39+
40+
41+ EXEC MyClonedSP;
42+
43+ -- END;
3744
You can’t perform that action at this time.
0 commit comments