I try to create a simple T-SQL Statement Task by Sql Server 2014 GUI.
My flow:
- Right click on Maintenance Plan
- Choose Create new Maintenance Plan
- Choose the type (T-SQL Statement Task)
- I add by toolbox an activity for SQL Statement (a simple
SELECT * INTO mytable FROM anothertable
)
Now I want to choose the databases where I want to execute my task.
By property I've changed the DatabaseSelectionType
to SPECIFIC
but I haven't any form to choose database.
If I try with another task type (Index maintenance) I can choose the databases.
Surely, I'm wrong in some steps but I don't understand where.
Best Answer
Do not rely on GUI .. use TSQL instead :-)
Many options you have to do your simple task :
SELECT * INTO dbname.schema.mytable FROM dbname.schema.anothertable
use dbname; SELECT * INTO mytable FROM anothertable;
BTW, dont use maintenance plans - instead use Ola's maint solution