I don't have permission to execute xp_cmdshell procedure.
Is there anyway I could execute a query from different file?
I tried this and don't know if it is a good option:
--query1.sql
Create Procedure sp_1
as
Begin
declare @q1 varchar(MAX)
set @q1 = ' some complicated query '
exec(@q1)
End
--query2.sql
Create Procedure sp_2
as
Begin
declare @q1 varchar(MAX)
set @q1 = ' some complicated query '
exec(@q1)
End
--mainquery.sql
Exec sp_1
Exec sp_2
Any advice?