473,597 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parametrizar nombre de BD (Español)

Bueno a los suscritos que lean en español:

Sucede que quisiera parametrizar el nombre que la base de datos en un
SP, es decir :

Create Procedure Prueba
As
Begin
Select * From mibase..mitabla
End

En dode mibase, es mi base de datos, la que pobria tener distintos nombres.

No puedo usar exec pues solo tengo permiso de ejecución sobre el SP y
por motivos de seguridad no tengo permisos sobre la tabla (mitabla).

Además, estos procedimientos tienen querys con join a distintas bd, las
que me gustaría parametrizar, y además estas tablas se pueden llama
igual en bases de datos distintas. Por lo tanto, no puedo crear un sp
publico en la master.

La idea sería tener "sinónimos" o "constantes ", de modo de, apuntar en
los sp a estos objetos y no a nombre fijos, así, si el nombre de la BD
cambia, solo tendría que modificar el "sinónimo" o la "constante" y
ya... los SP funcionarían como si nada pasó.

Si alguien tiene alguna idea, le estaré profundamente agradecido.

Atte.

Enrique.

Pd: La explicación en gringo se las quedo debiendo.

Jul 20 '05 #1
1 4090
Enrique Nuñez Fuentes (en*****@vtr.ne t) writes:
Bueno a los suscritos que lean en español:
Quizás es mejor de usar un group en español, per ejempio
microsoft.publi c.es.sqlserver. Normalmente, escribimos en ingles aquí.

Mas, creo que comprendo la questión:
Sucede que quisiera parametrizar el nombre que la base de datos en un
SP, es decir :

Create Procedure Prueba
As
Begin
Select * From mibase..mitabla
End

En dode mibase, es mi base de datos, la que pobria tener distintos
nombres.

No puedo usar exec pues solo tengo permiso de ejecución sobre el SP y
por motivos de seguridad no tengo permisos sobre la tabla (mitabla).

Además, estos procedimientos tienen querys con join a distintas bd, las
que me gustaría parametrizar, y además estas tablas se pueden llama
igual en bases de datos distintas. Por lo tanto, no puedo crear un sp
publico en la master.


Hay solo due possibilidads: SQL dinamco, e "system procedures" in master.
Y ambas de cuestas solucionas son malas.

Ver también aquí: http://www.hayes.ch/sql/sql_dinamico.html#Dyn_DB.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3637
by: Oxygenearth | last post by:
Please who could help me with this... I had my structure in Win32, with Apache, PHP, and MySQL, I had a page in which I am transfering an image to the database in MySQL using PHP. But now I am in Apache/Linux/MySQL(FreeBSD) with the same files. My problem is.. when I try to submit the variables to the php file, this does not get the binFile, in other words, the file($_POST) does not pass throug the SUBMIT html statemenT, so it is not...
0
1732
by: Oscar22pr | last post by:
QUIERES GANAR DINERO PARA PAGAR TUS DEUDAS??? GASTE 5 MINUTOS DE SU VIDA EN LEER ESTO Y VERA QUE REALMENTE FUNCIONA. LEGALMENTE!!!!!! !!!IMPRIME ESTA HOJA ...YAAAAAAAAAAA!!! Permíteme empezar diciendo que FINALMENTE LO ENCONTRE !!!. En serio!, lo encontré!. Y eso que odio todos esos ESQUEMAS DE HACERTE RICO RAPIDO!!!. Odio esos esquemas de marketing con varios niveles, o de hacer órdenes por correo, o poniendo propaganda en sobre de
0
1058
by: Eduardo Quiroz Salinas | last post by:
eso... gracias -- ------------------------------- Eduardo Quiroz Salinas 09-5149349 eduardoquiroz@vtr.net -------------------------------
0
1272
by: edward.garnica | last post by:
Buenas Tardes.. Me pueden ayudar diciendome como puedo utilizar la función SendKyes para cerrar un programa que esta abierto en la barra de tareas.. O que comandos debo de darle para que el ejecute Control + Alt + Suprimir.. Muchas Gracias.. Edward Garnica C.
0
2736
by: Santiago Cassina | last post by:
Hi list. I just want to send to you an sql file containing tools for audit the UPDATE and DELETE statements in a database by saving all the modifications made by a network/system/database user. I hope you find it useful El Santi =====
4
3088
by: Dan Krantz | last post by:
I have the following template to ensure that a given number (val) falls into a range (between vmin & vmax): template<typename T> T ForceNumericRange( const T& val, const T& vmin, const T& vmax) { T retVal = val; if ( retVal < vmin ) retVal = vmin;
9
9817
by: aleplgr | last post by:
Hi! I'm trying to let the end-user select the language of the menues I'm showing him. To do that I've got this Selector class that shows the end user a combo box, a label and a button. In the combo box the user selects the language (English,Spanish,French,..) and when he clicks in the button shows the label in the language selected. This works fine but it's just one form, I need to change the language of all the menues in an application, so...
0
7886
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8272
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8258
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6688
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5431
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1494
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1238
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.