Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2004, 10:58 AM
Authorized User
 
Join Date: Jul 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default how do you do this in SQL server?

Hello again to all,

I posted this question in the Oracle group first and got no responses, so I'm hoping I get better luck here.

The reason I posted this there first is because I know the concept in Oracle and was hoping that someone who knew Oracle and SQL Server would understand the analog concept in SQL Server. But again, no luck.

In Oracle, there is a database object called a SYNONYM. In a nutshell, a synonym is like an alias you can give an object which you can make public or private that allows users to refer to the object as long as they have underlying privledges on the base object. This allows users to call or proc or select from a table using the synonym and avoids them having to always type out <database>.<owner>. before the object name. It is handy. It can also keep your users from knowing the owner (schema name) of the base object for security reasons -- but that's not my main goal here.

I have two stored procs that I want to make available to all our SQL Server developers and have noticed that for system stored procs, one can just call them by typing sp_sysprocname. Is there anyway to give my procs the same functionality so that other developers won't have to type <database>.<owner>.<sp_myprocname> <parameter> and can just run the proc by typing sp_myprocname <parameter> ?

Thanks for any assistance.
 
Old July 19th, 2004, 02:39 AM
Authorized User
 
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you do not have a constraint of where (on which database) to create the stored procedures, I think you achieve this by creating the stored procedures in Master database with the name staring with "sp_" and with "dbo" previleges.

SQL Server looks in Master database first and executes if the stored procedure name is starting with "sp_".
 
Old July 19th, 2004, 11:52 AM
Authorized User
 
Join Date: Jul 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks ram2098, I will try that.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 03:34 AM
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
migrating from sql server 2000 to sql server 2005 abinashpatra SQL Server 2005 2 December 1st, 2006 03:45 PM
SQL Server sync with net server and browser server ne SQL Server DTS 0 June 13th, 2005 06:29 PM
SQL Server 7.0 talking to SQL Server 2000 msavage SQL Server 2000 1 August 20th, 2003 01:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.