创建.vbs文件。指定生产目录。
Dim i, y
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile("C:\Users\xxxxx\Desktop\SQL\file1.txt", True)
' 写入文本
For i = 2019 To 2040
objTextFile.WriteLine("delete from mc_s_l_" & i & " where create_time < '2024-05-09 12:33:38';")
Next
MsgBox "ok..."
' 关闭文件
objTextFile.Close
' 清理对象
Set objTextFile = Nothing
Set objFSO = Nothing