This content has been marked as final. Show 7 replies
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
an sp_who query? This would be similar to using the applicationName
in an ASP.Net web.config file.
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.
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.
I believe you want:
This will print the name of your application that you set in your Application.cfm or Application.cfc template.
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?
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.
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"
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.