Create a global static variable in SQL Server?
问题 Is there a way to create a global variable in SQL Server, in such a way that it persists even if the server is restarted, so I can use it in functions? Example from what I need: DECLARE @@DefaultValue bit This variable should never be deleted unless I explicityl do so. 回答1: I guess this will work the best for me: CREATE FUNCTION [dbo].[fn_GetDefaultPercent]() RETURNS decimal(5,4) AS BEGIN RETURN 1.0000 END 回答2: You can have a look at something like this "Global variables" in SQL Server 回答3: