Question : SQL Scripts in a .bat file?

Or maybe even a scheduled task that you could also manually run? Would like for a user to be able to clear out a table using a desktop icon, would love a batch file but have no idea how to go about making one that includes the SQL log in and then the script. As an example, let say the SQL log in was Admin, the password was Admin1, the SQL instance was Server\DATA_SQL and the database is Data and the table needing to be cleared is FailedLogIns. What would be the easiest set up for the "user"?

Answer : SQL Scripts in a .bat file?

you probably want to use the SQLcmd  batch file program just create a sql script with the commands you want executing...

preferably within a  stored procedure...

then for the user id's just use windows authentication and a (-E parm) Tristed Login so that you don't have to worry about coding userids/passwords...

sqlcmd -Sservername -ddatbaseName -E   -iInputfile -oOutputfile
Random Solutions  
 
programming4us programming4us