cancel
Showing results for 
Search instead for 
Did you mean: 

Wildcards for SQL Batch Script

Laurence_Merry
Level 5

I was speaking to our SQL Manager this morning and he voiced a pain point he has using the SQL Scripts (I've tried to get them to switch to SQLi policies but to no avail).

His issue is having to exclude DBs from a backup. Is there a way to use a wild card for the EXCLUDE option?

 

1 ACCEPTED SOLUTION

Accepted Solutions

StefanosM
Level 6
Partner    VIP    Accredited Certified

If I was the SQL admin:
I would write a script to discover the sql databases that I do not want to backup and populate (or recreate) the netbackup script with the correct lines for every database.

This script can be run manually or with windows scheduler every day, before the backup

 

View solution in original post

4 REPLIES 4

Nick_Morris
Level 6
Partner    VIP    Certified

I'm not aware there is a wildcard option for exclude option. My only thinking is move these DBs in a different instance and don't backup that instance.

Thanks Nic, unfortunately access to the DBs is outside of my control, I checked the SQL admin guide but didn't find anything so thought I'd ask the community.

StefanosM
Level 6
Partner    VIP    Accredited Certified

If I was the SQL admin:
I would write a script to discover the sql databases that I do not want to backup and populate (or recreate) the netbackup script with the correct lines for every database.

This script can be run manually or with windows scheduler every day, before the backup

 

Thanks for your input, I'll take this to the SQL manager then. The problem is, some of his DBAs follow the standard and some do not. But its the best I have to work with. Thank you.