7 Replies Latest reply on Oct 4, 2006 8:36 AM by CF_Doctor

    Application Name and SQL/EM

    CF_Doctor
      Is there a way to make sure that when a user is accessing data in SQL via a CF template, that the application name in Application.cfm is displayed as part of an sp_who query? This would be similar to using the applicationName attribute in an ASP.Net web.config file.

      Cheers,
      Alex
        • 1. Re: Application Name and SQL/EM
          Level 7
          Is there a way to make sure that when a user is accessing data in SQL
          via a CF
          template, that the application name in Application.cfm is displayed as
          part of
          an sp_who query? This would be similar to using the applicationName
          attribute
          in an ASP.Net web.config file.

          Cheers,
          Alex

          I don't understand what you are asking, I don't know enough about
          ASP.net to get your reference.

          But you can access that applicaiton name with
          #application.applicationName# if that helps.
          • 2. Re: Application Name and SQL/EM
            CF_Doctor Level 1
            What I mean is if you go into SQL Enterprise Manager, start up a Query Analyzer session and type "sp_who" you'll get a table of data for all the current connections to the server including the program name that is accessing the database. I'd like a way to get the application name from a CF template to display in the program name column much like an ASP.Net application will display its name there.

            Cheers
            • 3. Re: Application Name and SQL/EM
              LeftCorner Level 1
              I believe you want:

              <cfoutput>#Application.ApplicationName#</cfoutput>

              This will print the name of your application that you set in your Application.cfm or Application.cfc template.
              • 4. Re: Application Name and SQL/EM
                CF_Doctor Level 1
                That will only print the name into a CF template or a text file if I should be creating one. "sp_who" is a SQL system stored procedure that retrieves an application's name from running processes in the control applet. So, basically, the CF application must show up as a process in the Task Manager for this to work. Is there any way to make that happen?

                Cheers.
                • 5. Re: Application Name and SQL/EM
                  LeftCorner Level 1
                  I understand what you are asking but I don't know the answer. I believe it to be blank in SQL Server. I don't believe ColdFusion uses the datasource name, or any other datasource varaible, to identify itself to SQL as an application.

                  When profiling I filter by the user on the datasource, which is a SQL account with the least privledges possible and is a separate account for each application. I then profile accounts rather than applications, so I'm afraid I cannot help you on this matter. Sorry.
                  • 6. Re: Application Name and SQL/EM
                    Level 7
                    So, basically, the CF application must show up as a process in the Task
                    Manager for this to work. Is there any way to make that happen?

                    I don't think so. The ColdFusion process shows up in the task manager
                    simple as "JRun". All CF applications executed under one or more "JRun"
                    processes.
                    • 7. Re: Application Name and SQL/EM
                      CF_Doctor Level 1
                      I've found an answer to this issue that only works in CF4.5 and 5. In the CFQUERY, CFSTOREDPROC, CFINSERT, CFUPDATE and CFGRIDUPDATE tags you can use the connectString= attribute to pass the application name to MS SQLEM. The syntax looks like connectString="APP=Weborders;"

                      Unfortunately, this attribut is deprecated in versions greater than 5.x and is a known bug in the CF ADMIN for datasources under MX7.

                      Cheers.