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
 General SQL Server Forums
 New to SQL Server Programming
 Access SP in database on same server

Author  Topic 

insanepaul
Posting Yak Master

178 Posts

Posted - 2011-07-04 : 11:27:19
I just come across the code below to access a stored procedure on the 'COR' database. I didn't recognise the .. notation. I thought brackets were used for this but when I tried to use brackets it didn't work. Is the code below the only way to access the SP then?

EXEC COR..usp_PhoneDonation_sel_tblCORPerson

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2011-07-04 : 11:42:50
it's shorthand for COR.dbo.usp_PhoneDonation_sel_tblCORPerson

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2011-07-04 : 11:43:24
(dbo is the default schema)

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-07-04 : 11:44:48
EXEC COR..usp_PhoneDonation_sel_tblCORPerson

The name of the SP alone is usp_PhoneDonation_sel_tblCORPerson

COR is the databasename
.. is the standard schema

You can also write EXEC COR.DBO.usp_PhoneDonation_sel_tblCORPerson


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

Go to Top of Page

insanepaul
Posting Yak Master

178 Posts

Posted - 2011-07-04 : 12:14:20
quote:
Originally posted by webfred

EXEC COR..usp_PhoneDonation_sel_tblCORPerson

The name of the SP alone is usp_PhoneDonation_sel_tblCORPerson

COR is the databasename
.. is the standard schema

You can also write EXEC COR.DBO.usp_PhoneDonation_sel_tblCORPerson



Thanks Webfred and charlie transact - makes sense now
Go to Top of Page
   

- Advertisement -