hello,
I've added a sql file via TortoiseHg to my Mercurial repository and it went in a a binary file rather than text.
1) Can I change it to text so that I can see revision changes through the web interface like all my other source files?
2) Was there something I missed when adding which caused this?
Thank you.
The problem turns out to be that the file was created in unicode rather than ansi text encoding by SQL Server Management Studio. It was a default option on the export task.
Mercurial does not play nicely with it and adds it to the repository as a binary file which will not allow previewing or diffs from TortoiseHg or the web interface.
So, to answer my original question of how to change it after it has been added, I opened it in notepad and saved it as an ANSI file. Now it works.
In case someone who runs across this has a lot of these files, like I did, you could run this PowerShell script to update all of your .SQL files at once.
Get-ChildItem -Recurse *.sql | foreach { $FileName = $_.FullName; [System.Io.File]::ReadAllText($FileName) | Out-File -FilePath $FileName -Encoding UTF8; }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Greetings!
SQL files, like images (.jpg, etc) are generally transferred over SSH, FTP and SCP in binary (BIN) format.
The standard approach would be to load the SQL file into a local DB such as MySQL and from there you can select data as well as export data.
If you really want to convert the data to text format, most likely your best bet is to research/find/download a 3rd party application or you might get lucky by using wordpad or other word editors.
For 3rd party solutions, I just did a google search and found several hits, for example: http://convert.software.informer.com/download-convert-sql-file-to-text-file/
I hope this response was helpful.
Cheers,
Jason | Atlassian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.