How do I change the naming convention for script files in SQL2005?

SQL Server 2005 Express Edition SP2 supports scripting objects to separate files. By default, file names include the name of the owner of the object, the name of the SQL object, followed by the type of the object. For example, dbo.Employee.Table.sql or dbo.GSP_EmployeeUpdate.StoredProcedure.sql. While this naming convention can help you quickly identify what is written in a given file, it does not help in organizing the files (i.e. I cannot sort by object type.) So I would like to change the file naming convention. Is it possible?

0


source to share


1 answer


I don't know if such a setup is possible, but what about using PowerShell like this:


ls | % {rni -path $_.Name -new ($_.name.Split('.')[0] + "." + $_.name.Split('.')[2] + "." +$_.name.Split('.')[1] + "." +$_.name.Split('.')[3])}

      



Can someone give an even better snippet?

+1


source







All Articles