• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Application Name and SQL/EM

Community Beginner ,
Sep 08, 2006 Sep 08, 2006

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

601

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Oct 04, 2006 Oct 04, 2006
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.

Votes

Translate

Translate
LEGEND ,
Sep 08, 2006 Sep 08, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 09, 2006 Sep 09, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 09, 2006 Sep 09, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 09, 2006 Sep 09, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 09, 2006 Sep 09, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 11, 2006 Sep 11, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 04, 2006 Oct 04, 2006

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation