Skip to content

SQL Diary & my notes

A normal day in a life of SQL Professionals

  • Home
  • Blog
  • About

Day: October 22, 2024

How to rename all .sql files in a folder to have a new running sequence using PowerShell

$files = Get-ChildItem -Path . -Filter "*.sql"$counter = 5foreach ($file in $files) {$newName = "{0:D2}-$file" -f $counterRename-Item -Path $file.FullName -NewName $newName$counter++} Original sql files in a folder After execution of above script, files are renamed.

Posted on October 22, 2024October 22, 2024 by Manish KaushikPosted in Power ShellLeave a comment

Archives

  • Constraints
  • Power Shell
  • Python
  • Questions
  • Scripts
  • Stored procedure
  • Uncategorized
October 2024
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Aug    

Python script Stored procedures

Follow SQL Diary & my notes on WordPress.com
Create a website or blog at WordPress.com
  • Subscribe Subscribed
    • SQL Diary & my notes
    • Already have a WordPress.com account? Log in now.
    • SQL Diary & my notes
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...