App_name()

  • Hello !

    I would like to know app_name() from visual basic application. I run the application and save the name in temp table. After that when I check the application name from that table, it is null. How can I get the app_name() from VB side.

    Thanks a lot!

  • try

    app.name

  • If you are getting null then the Application Name Property in the Connection is not set.

    Add the Application Name Value to your  SqlConnection connection string

    application name="Northwind_Test-1.1"

    This can be added in the Connection Wizard under the "All" tab... Application Name Edit value

    When using SqlConnection it would look something like this.

    application name="Northwind-Test-1.1";packet size=4096;integrated security=SSPI;data source=DEVELOPER;persist security info=False;initial catalog=Northwind

    Then in your Stored Procedure or Trigger when you use the T-SQL app_name() function it would return the application name property.

    Like so: Insert into tmpApp( App) Select app_name()

    I would use this in triggers to test where the transaction was comming from to run different rules... and track version issues... works great.

  • Thank you so much, Dan Collier. I got it now!:

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply