sql server - Equivalent to Compiler Options in T-SQL -


i have database running customers under sql 2012 , other under sql 2014. want use in memory tables , - possible - native compiled procedures access them.

is there way write create / alter procedure functions in way (for example compiler options) same sql script file runs under 2012 , 2014 , adds native keyword under 2014?

of course, duplicate procedure , use simple if check server version / configuration / whatever , run either script native_compilation or 1 without duplicated code tends differ in unwanted lines, particularly if not 10-liner procedure :-(

example (with delphi compile option syntax):

create procedure dbo.compute_salaries @datefrom date {$ifdef inmemoryon}with native_compilation{$endif} begin    declare ... 

another purpose of using "compiler options" be, name of partition schemes / functions differ , nice have way create new tables / indexes without duplicating create script or using dynamic sql.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -