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
Post a Comment