Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Stored Proc reports Master as database name

Author  Topic 

rbrickey
Starting Member

2 Posts

Posted - 2010-10-26 : 11:22:59
Hey everyone.
Hope you can offer some insight. I have a stored proc that reports the database name as Master, when I know its not. Any ideas what would cause this? maybe how the proc runs or how it connects to the server?

Any suggestions are appreciated.

Thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-26 : 11:40:36
What do you mean when you say that a stored procedure "reports the database name"?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

rbrickey
Starting Member

2 Posts

Posted - 2010-10-26 : 11:52:57
the profiler trace of an event shows a different database (master) than the event really ran against(production).
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2010-10-26 : 12:51:12
ouch your prod sproc might be referring to tables on your dev box. make sure you are not referencing dev objects in your sproc. sounds like someone forgot to clean up sproc when moving it to production.

meaning you could have

devserverdb.dbo.master or devserverdb.dbo.chickenwings when it should be productionserver.dbo.chickenwings

do you have your production database on same box as dev database?
do you have your dev server linked to prod server
do you have your prod server linked to dev server

If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -