question

Beanstalk avatar image
Beanstalk asked

Code Base Management Scheme for various SQL Server Versions

How are people maintaining a code base for a product that has customers on various versions of SQL server?? I'm hoping its not all "lowest common denominator" for code because we would like to be able to provide customers that have SQL Server 2016 ... with that versions benefits .. while also supporting customers with SQL Server 2008. For example, a function that would return if a table is memory-optimized in 2016 might look like : CREATE FUNCTION is_memory_table ( @tableName sysName) RETURNS int AS BEGIN DECLARE @ReturnValue INT; SELECT @ReturnValue = is_memory_optimized FROM SYS.Tables WHERE name=@tableName; RETURN @ReturnValue; END However, this code would error in trying to Create it in 2008 because that is_memory_optimized flag doesn't exist. So you might have CREATE FUNCTION is_memory_table ( @tableName sysName) RETURNS int AS BEGIN RETURN 0; END So, How are people handling this kind of idea? It can be big and unrealistic to try to always have a script with code written with Dynamic SQL... but, at the same time... multiple files for the same object might not work either because of maintenance of the code base. If anyone has a link that I haven't found where this is discussed, I would love to investigate it.
code
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.