Requirement:
We stored our db objects script in our repository. Once we done our new enhancement project, we need to compare the source code repository copy with SQL Server Script.
a) we stored in repository as usp_updateEmployee.sql (more than 100 files are there)
b) The sql Server script gives as dbo.usp_updateEmployee.storedprocedure.sql
To compare I need to rename the sql server script like in my source code repository. the below powershell script solved the issue:
a) remove dbo.
We stored our db objects script in our repository. Once we done our new enhancement project, we need to compare the source code repository copy with SQL Server Script.
a) we stored in repository as usp_updateEmployee.sql (more than 100 files are there)
b) The sql Server script gives as dbo.usp_updateEmployee.storedprocedure.sql
To compare I need to rename the sql server script like in my source code repository. the below powershell script solved the issue:
a) remove dbo.
Dir | Rename-Item -NewName
{ $_.Name -replace "dbo.","" }
now the names like usp_updateEmployee.storedprocedure.sql
b) then remove .storedprocedure
Dir | Rename-Item -NewName
{ $_.Name -replace ".StoredProcedure","" }
Now we got the required filenames for all files like usp_updateEmployee.sql
No comments:
Post a Comment