-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Ed Elliott's Sql Developer Blog

Ed is a Sql developer who has a mixed background in support, as a dba and as a developer working with a number of languages c, c#, vb, go, assembly with a variety of technologies and is currently trying to make the sql developer community a little bit more agile, one build step at a time!

Archives: November 2015

Find duplicate indexes in SSDT

Update new download location is https://visualstudiogallery.msdn.microsoft.com/435e7238-0e64-4667-8980-5...

Duplicate indexes, one of the most pointless things you can do to a table that just adds pure overhead. No one likes them so SQL Developers do your DBA's a favour and stop them from ever being deployed :)

This new tool for the…

Read more

0 comments, 617 reads

Posted in Ed Elliott's Sql Developer Blog on 27 November 2015

Convert select statements in scripts into Inline-TVF's automatically

Update new download location is https://visualstudiogallery.msdn.microsoft.com/435e7238-0e64-4667-8980-5...

In-line TVF's are awesome, they are a great way to reuse T-SQL code without the performance penalties of multi line TVF's or horror of horrors Scalar Functions. Taking select statements and turning them into in-line TVF's is actually really really simple using the TSql…

Read more

0 comments, 505 reads

Posted in Ed Elliott's Sql Developer Blog on 25 November 2015

ScriptDomVisualizer - Now Displays TSqlParserToken's

New ScriptDom visualizer now also shows the tokens that are found in a sql script. It also highlights the part of the query that is covered by the token so it is really easy to see where you are in the script.

Honestly if you are doing anything with the…

Read more

0 comments, 581 reads

Posted in Ed Elliott's Sql Developer Blog on 25 November 2015

Changing case of T-SQL Keywords

Update new download location is https://visualstudiogallery.msdn.microsoft.com/435e7238-0e64-4667-8980-5...

Bert likes his T-SQL keywords in UPPERCASE, Ernie likes his in lowercase which causes some internal struggle as it is actually one person "Mr Bert Ernie" anyway I digress, whether you are working by yourself or in a team you sometimes want to change…

Read more

0 comments, 2,546 reads

Posted in Ed Elliott's Sql Developer Blog on 24 November 2015

Quickly deploying procedure/functions from SSDT (Bypass Publish)

SSDT is great but one thing that is not so great is the performance of the publish. I am not complaining, I understand it does a lot and is well worth the wait when publishing however, when you are writing and testing code having this process really kills productivity:

  • 1.…

Read more

0 comments, 317 reads

Posted in Ed Elliott's Sql Developer Blog on 24 November 2015

Using the ScriptDom without losing comments

The ScriptDom is cool, it lets you parse T-SQL, play around with the AST (tree of statements) and then generate T-SQL again (probably in a different format etc). This is really cool but if you round-trip the T-SQL into an AST and back you lose some important information like comments…

Read more

0 comments, 439 reads

Posted in Ed Elliott's Sql Developer Blog on 24 November 2015

SSDT DevPack - Highlight expensive queries

When developing stored procedures in SSDT it is important to know when you have written a query that is potentially slow or has a high IO or CPU cost but there is no real way other than examining the the tables you are querying and understanding the data volumes and…

Read more

0 comments, 1,553 reads

Posted in Ed Elliott's Sql Developer Blog on 22 November 2015

Create stub tSQLt tests in SSDT from stored procedures

I have released another tool as part of the ssdt dev pack, what this does is create tSQLt classes and stub tests. If you open a stored procedure in ssdt and then do "Tools--> SSDT Dev Pack--> Create tSQLt Class" or you can create a keyboard mapping in "tools->options->keyboard", what…

Read more

0 comments, 1,683 reads

Posted in Ed Elliott's Sql Developer Blog on 17 November 2015

Automatically name primary key constraints in SSDT

Automatically name primary key constraints

There are some things you see when writing t-sql code and schemas that just look sloppy, one of those is unnamed constraints, what you see is:


create table t(
id int not null primary key
)

The problem with this is that the primary key…

Read more

0 comments, 262 reads

Posted in Ed Elliott's Sql Developer Blog on 16 November 2015

New Version of MergeUi

I have made some changes to the way MergeUi works and also moved it into a new repository (https://github.com/GoEddie/SSDT-DevPack).

The way MergeUi used to work was that it enumerated the schemas and tables in a project and let you create a merge statement in the post-deploy script. The…

Read more

0 comments, 1,477 reads

Posted in Ed Elliott's Sql Developer Blog on 12 November 2015

How to get started with the ScriptDom

What is the ScriptDom?

The ScriptDom is an api for taking t-sql scripts, converting them into an AST or taking an AST and generating t-sql.

What is an AST?

Read this: https://en.wikipedia.org/wiki/Abstract_syntax_tree

Think about this:

select col from tablea
select col from tablea
select col /*from not_table*/ from tablea
select…

Read more

0 comments, 781 reads

Posted in Ed Elliott's Sql Developer Blog on 7 November 2015

ScriptDom Visualizer V2

I have made a few ui changes to this to make it a little more usable, I can't really think of any new features so if anyone has any ideas let me know :)

New version (slightly prettier):

https://github.com/GoEddie/ScriptDomVisualizer/blob/master/release/Scrip...

Read more

0 comments, 365 reads

Posted in Ed Elliott's Sql Developer Blog on 6 November 2015

Blocking SSDT Deployments When You Don't Like Something

This is probably the last contributor that I am going to add to the DacFx deployment contributors project (https://github.com/DacFxDeploymentContributors/Contributors/) for a little while, if anyone else has one they want to contribute please feel free. I have been pretty pleased with how they went but want to make…

Read more

0 comments, 306 reads

Posted in Ed Elliott's Sql Developer Blog on 6 November 2015

SQL Server Edition aware SSDT deployment scripts

Another day another deployment contributor for the project: https://github.com/DacFxDeploymentContributors/Contributors.

This one came about because I was talking to Peter Schott (b|t) over at the deployment contributor gitter room and he has dacpac he wants to deploy to different editions of sql server and enable different…

Read more

0 comments, 249 reads

Posted in Ed Elliott's Sql Developer Blog on 5 November 2015

Deploy SSDT INSERTS in Batches

I have added my first actual deployment contributor to my deployment contributor project:

https://github.com/DacFxDeploymentContributors/Contributors

The idea is basically for people to share ideas about writing deployment contributors for SSDT and help each other. If you don't know what a deployment contributor is then you are missing a real treat. A…

Read more

0 comments, 353 reads

Posted in Ed Elliott's Sql Developer Blog on 4 November 2015

ScriptDom Visualizer

Writing code to generate TSql using the ScriptDom is hard. There is a seemingly bewildering array of objects you can use and where you use different types is unclear, I think this is due to the complexity of the task, it really isn't simple and dealing with t-sql gets complicated…

Read more

0 comments, 306 reads

Posted in Ed Elliott's Sql Developer Blog on 3 November 2015

Shared SSDT Deployment Contributor Repository and Free Help

One of the best features of SSDT is deployment contributors. They are so exciting I am going to say it again with more gusto. One of the best features of SSDT is deployment contributors.

What these do is let you examine or modify the deployment script that is generated…

Read more

0 comments, 341 reads

Posted in Ed Elliott's Sql Developer Blog on 2 November 2015

Looking at SSDT upgrade scripts

I have been using SSDT seriously for a couple of years now and have really been impressed with the code that is generated to upgrade schemas and over that time have learnt to trust that SSDT generates good upgrade scripts.

It is however a concern that a tool generates the…

Read more

0 comments, 374 reads

Posted in Ed Elliott's Sql Developer Blog on 1 November 2015