database - Running multiple stored procedures in SQL Server -


I am trying to run the following code

  go to USE [cp_mydatabse] Process [DBO] Start as [SP_myProcedure] if selected from Master Assis Database, name WHERE name = 'tempDB') EXEC SP_UpdatetempDB - Copy data from second data base END ELSE BEGIN Print 'database does not exist' EXEC SP_CreatetempDB - create My Database SP EXEC SP_CreatetempDBTables - Create the table SP EXEC SP_UpdateTEmpDBData - Copy the data from another database END  

If my tempDB is present, then I found that the code is running < Code as> EXEC SP_CreatetempDB as well. What is the reason for that ? But I can not see

  print 'database does not exist'  

Output on my console Do you have any information about it?

Thanks in advance.

Try it:

  Alternate Processes [DBO]. [SP_myProcedure] as if existing (master.sys.databases by selector name where name = 'tempDB') BEGIN EXEC SP_UpdatetempDB - Copy data from other data base END ELSE BEGIN print 'database does not exist' EXEC SP_CreatetempDB - its database Create SPXx SP_CreatetempDBTables - Create table SP EXEC SP_UpdateTEmpDBData - Copy data from second database END  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -