views:

42

answers:

1

SQL Server 2005 Express Edition SP2 supports scripting of objects into separate files. By default, the filenames include the name of the object's owner, the name of the SQL object followed by the object type. For example, dbo.Employee.Table.sql or dbo.GSP_EmployeeUpdate.StoredProcedure.sql. Though this naming convention may help one to quickly determine what's scripted within a given file, it doesn't help with file organization (i.e. I can't sort by object type.) Therefore, I would like to change the file naming convention. Is this possible?

+1  A: 

I don't know if customization like this is possible but what about using little PowerShell like this:


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

Maybe someone can give even better snippet ?

Robert Vuković
Thanks for the idea, Robert. I was worried I'd have to use a utility like PowerShell in order to alter the names.
Ben Griswold