I want to add some custom attributes in SqlServer connection string, something like this:
Integrated Security=SSPI;Extended Properties=\"SomeAttr=SomeValue\"
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.