(SQL server) Collation when creating a database
See original GitHub issueHi @Zaid-Ajaj,
When creating a new ThrowawayDatabase I need to specify a custom collation for the entire database, so my required SQL script is as follows:
CREATE DATABASE [MyDatabase] COLLATE MyCollation
Currently a workaround is possible by running this script after the ThrowawayDatabase has been created, but wouldn’t it be nicer if the collation could be specified already when creating the database?
ALTER DATABASE [MyDatabase] COLLATE MyCollation
If you think it’s a good feature to have I could help with a PR. I have already considered an option how it can be done. My first idea was adding a new optional string parameter, but unfortunately it results in the overload problem of the Create method.

Therefore, I think the only option would be adding a new class (e.g. ThrowawayDatabaseOptions) with all the required parameters (currently DatabaseNamePrefix and Collation), but it’s a breaking change of the API.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (13 by maintainers)

Top Related StackOverflow Question
That worked!! 😍 Just ran all tests and all 31 of them passed ✔️
I will do it then 😎