How to add custom attributes to SQL connection string?

后端 未结 2 1865
北恋
北恋 2020-11-28 11:08

I want to add some custom attributes in SqlServer connection string, something like this:

Integrated Security=SSPI;Extended Properties=\"SomeAttr=SomeValue\"         


        
2条回答
  •  庸人自扰
    2020-11-28 11:26

    You can use the WSID and APP keywords in the connection string. You can read those values using the HOST_NAME() and APP_NAME() functions. See http://msdn.microsoft.com/en-us/library/ms130822.aspx for details.

提交回复
热议问题