473,421 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

Changed database context to 'xxxx'.

I need to get rid of this message on my report:Changed database context to 'xxxx'.

Thank you!
Aug 20 '10 #1
9 20687
Jerry Winston
145 Expert 100+
Update your adult content filters.

No, that was an attempt at humor.

Seriously, though, we will need to know a lot more about what you are trying to do and what you have done so far before we can possibly be of any assistance.

What data source?
What report?
What software?
What versions?
What OS/Servers?
Aug 20 '10 #2
Jerry: Thank you again, here is some of the facts being used: I just execute a simple query and then I use "EXEC msdb.dbo.sp_send_dbmail" to email it some of my co-workers as an EXCEL file.
Aug 20 '10 #3
Alex Papadimoulis
26 Expert
From which system are you executing this query from? For example... are you just using like SQL Query Management Studio? Or, do you have a web application connecting to SQL?
Aug 20 '10 #4
Alex:

I am executing this SQL script as a JOB from within the SQL Management Studio and works great except that the first row in my Excel file has the line that says "Changed database context to 'xxxx'."
Aug 20 '10 #5
code green
1,726 Expert 1GB
In my experience this error usually means a timeout or memory overload.
At some point in the query there is too much data.
Aug 23 '10 #6
Jerry Winston
145 Expert 100+
Is the:
Expand|Select|Wrap|Line Numbers
  1. USE [myDbName]
line absolutely necessary? If you can run your processes from on database, you can eliminate this message by not switching database context. You can start your TSQL job step script in the context of source database.
Aug 23 '10 #7
NeoPa
32,556 Expert Mod 16PB
Which network account is the SQL Server Agent configured to use?
Is this account set up with the ability to email (A default account of System would not be for instance)?
Aug 23 '10 #8
The solution to my problem,was quite simple; Everytime I used SP_Send_dbmail with a file attachment, the first line on my output was "Changed database context to 'XXXXX'. I found that when using SP_SEND_DBMAIL, I just needed to use the parameter "@execute_query_database=XXXXX"; This simple entry, eliminated that annoying output line!!!

Thanks for all your help!
Aug 31 '10 #9
Jerry Winston
145 Expert 100+
Thanks for coming back and posting the solution!
Aug 31 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: mdh | last post by:
I am trying to learn the basics of MVC applications using a Tomcat infrastructure. I'm starting by building a simple application with: * a login.jsp page for a basic login form with a action...
5
by: FoxRunner | last post by:
Hi folks, I got a script which restores a database. It works fine if it is running in my Query Analyzer. It fails when I put this script in an automated schedule using the SQL agent. This...
2
by: Jim Andersen | last post by:
Hi, Used the wizard to create a maintenance plan for a db. But it fails most of the time. I checked the log-files. At 1.00 AM, it runs the "Optimizations" job for 6-9 seconds. It succeeds...
10
by: David | last post by:
Does anyone know where I can find example code for VB.NET that I can use to create an application that attaches and detaches databases to MSDE using osql scipts. (I think SQL-DMO is typically...
10
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the...
1
by: Shift4SMS | last post by:
This is probably an easy one but I'm banging my head against the wall trying to sculpture the perfect Google search. Anyway... Is there a way to determine the current connection's database...
4
by: Andrus | last post by:
For winforms application with multiple related forms it is reasonable to create Linq database context object in start of application. Context object is released only when application exits. So...
2
by: shapper | last post by:
Hello, I created a connection to my SQL Server in Visual Studio 2008. How can I delete a database? I tried: Drop database MyDb It didn't work. Thanks,
3
by: =?Utf-8?B?RW1tYQ==?= | last post by:
Hello I have a database which I access through the Internet using ASP now my SELECT statement isn't working now that I've changed the text values of Yes/No to boolean values of Yes/No. What can I...
25
by: pereges | last post by:
Hello, I'm trying to build a database driven website for a library management system. The database is stored on a remote server which all of my team mates can access. I've installed MySQL, PHP and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.