Link to home
Start Free TrialLog in
Avatar of Luis Diaz
Luis DiazFlag for Colombia

asked on

SQL: launch actions one before the other

Hello experts,
I have the following query which I launch manually action 1 before action 2 and so one.

/**Action 1**/ 
USE [mstt] 
GO 
DROP USER [ecube_user] 
GO 
/*********/ 
/**Action 2**/ 
USE [mstt] 
GO 
CREATE USER [ecube_user] FOR LOGIN [ecube_user] 
GO 
/*********/ 
/**Action 3**/ 
USE [mstt] 
GO 
ALTER USER [ecube_user] WITH DEFAULT_SCHEMA=[mstt_schema] 
GO 

/*********/ 
/**Action 4**/ 

/*****V7****/

GRANT SELECT ON mstt.mstt_schema.RequestXL03 TO [ecube_user] 
GRANT SELECT ON mstt.mstt_schema.CommitmentsXL03 TO [ecube_user] 
GRANT SELECT ON mstt.mstt_schema.TransactionXL03 TO [ecube_user] 
GRANT SELECT ON mstt.mstt_schema.ResourceAD08 TO [ecube_user] 
GRANT SELECT ON mstt.mstt_schema.TaskLAD03 TO [ecube_user] 
GRANT SELECT, INSERT, UPDATE, DELETE ON mstt.mstt_schema.IDS_Modified TO [ecube_user] 
GRANT SELECT, INSERT, UPDATE, DELETE ON mstt.mstt_schema.IDS_Resources TO [ecube_user]
GRANT SELECT ON mstt_schema.TT_Hours_Ecube TO [ecube_user]


/*****V6 ET V7****/

GRANT SELECT ON mstt_schema.TT_Hours_Ecube TO [ecube_user]
GRANT SELECT ON mstt_schema.TT_Hours_Ecube_1 TO [ecube_user]
GRANT SELECT ON mstt_schema.TT_Industry TO [ecube_user]



/*****V6 Temporaire****/

GRANT SELECT ON [mstt_schema].[TT_Hours_Ecube_dec] TO [ecube_user]

Open in new window


I was wondering how to cuztomize it in order to launch directly the query instead of selecting action by action.

Thank you very much for your help.
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

How do you mean launch directly?
If you are using SSMS just press F5 to execute all but confirm that you do not have any line selected or you can select all lines of the script and the press F5 to run all.
Avatar of Luis Diaz

ASKER

What I do is that I select Action1 part and I launch the query then Action2 and I launch the query.
The think is that the previous action need to be generated after the next one so I can not select all and run the query.
SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much for your help.

Is there a way to plan a stock proc in order that it launched automatically every day?
Additionnally, we are sure that the Stock proc launch every update one before the other?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much for your help.
Glad to help !