If you write code to SQL Server then you might be interested in this: at the end of 2017 I wrote a tSQLt tdd training course which has helped over 300 people learn both tSQLt and how to apply TDD practices to their SQL Server T-SQL development, you can join the course at https://courses.agilesql.club. The course is free if you are happy to wait 10 weeks to complete it, with 1 lesson being made available per week - if you are in more of a hurry or you would like to help support the project you can purchase the course which makes it instantly available to you.
Ok so you have created an SSDT project and are currently congratulating yourself on how awesome and cool you are but then you realise that your project is like an empty void, completely devoid of any emotion, love or joy - there is no schema and code in the project and you have all that lovely T-SQL sitting in a database, now how the hell do you get it into SSDT?
First of all, let’s think about it like this:
So the options are:
1 - Import
You can import into an empty project from a dacpac or a live database, just right click on the project, choose “Import” and then dacpac or Database. You can only use these options on an empty project.
You can additionally import from a script file at anytime, whether the project is empty or not. If you choose to import from a script you can either import a single file or multiple files, which is useful if you have lots of files to import.
2 - Schema Compare
If you create a schema compare in SSDT, either right click the project and choose “Schema Compare” or browse to a database in the Sql Server Object Explorer, right click (the database) and also choose “Schema Compare”, set the source of the compare to the live database and the target to be the project you want to update and then do a compare and an update and bob is your uncle.
3 - Fingers
The last option is to type stuff in, it isn’t very difficult and you can make it do exactly what you want!
But I want to import a dacpac into an existing project, boo hoo hoo
You could import to a new one and copy and paste the files into your actual project, that would work nicely.
A short post today but hopefully useful. Just a little reminder that if anyone wants some free help to get started with CI or agile sql practices then give me a shout, either by email or give me a call, full details: