I have tried adding this to the .gitattributes:
* text=auto *.sql diff
But it still shows like this:
BIN WebRole/Sql/Objects/dbo.Content.Table.sql → WebRole/Sql/dbo.Content.Table.sql Binary file not shown
Would appreciate help with this.
gitattributes has a new working-tree-encoding attribute. As mentioned in "Set file as non-binary in git": "Why is Git marking my file as binary?" The answer is because it's seeing a NUL (0) byte somewhere within the first 8000 characters of the file.
The only method I found that worked was to change the encoding of .sql files from the default UTF16 encoding to UTF8. The below outlines three approaches based on your circumstances:
If you have many files to change and are comfortable with running Powershell scripts you may want to try the following:
In order to prevent having to convert files in the future you can alter the template for the new queries created in SSMS by using the approach outlined in this link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With