Is there a way to make this SQL smaller?
CASE
WHEN @contentType = 'PrimaryBannerItem' THEN
[dbo].[DeathStar_GetContentLink] (@contentId, c.content_id, @pageCollectionId, ISNULL(l.filename, ''))
ELSE
[dbo].[DeathStar_GetContentImagePath](ISNULL(a.mimetype, ''), ISNULL(c.image, ''), ISNULL(l.filename, ''))
END AS [Image],
CASE
WHEN @contentType = 'PrimaryBannerItem' THEN
dbo.DeathStar_GetMetadataValue(c.content_id, @urlMetadataId)
ELSE
[dbo].[DeathStar_GetContentLink](@contentId, c.content_id, @pageCollectionId, ISNULL(l.filename, ''))
END AS Link,
To make it look more like
CASE
WHEN @contentType = 'PrimaryBannerItem' THEN
[dbo].[DeathStar_GetContentLink](@contentId, c.content_id, @pageCollectionId, ISNULL(l.filename, '')) as [Image]
dbo.DeathStar_GetMetadataValue(c.content_id, @urlMetadataId) as [Link]
ELSE
[dbo].[DeathStar_GetContentImagePath](ISNULL(a.mimetype, ''), ISNULL(c.image, ''), ISNULL(l.filename, '')) as [Image]
[dbo].[DeathStar_GetContentLink](@contentId, c.content_id, @pageCollectionId, ISNULL(l.filename, '')) as [Link]
END
Because as you can see, it makes the code a bit more readable, it cuts down on the number of lines used and it avoid redundancy.