Click here to Skip to main content
15,911,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to change the database name and its change on stored procedure,view function.and this database procedure and view used another database table to create a result set.

Thanks in advance.

Vinay singh
Software developer
Posted
Comments
Sandeep Mewara 23-Feb-11 1:43am    
Not clear. What exactly you are trying to achieve/do and why?
thatraja 23-Feb-11 10:36am    
confusing question, clear that dude.....
pankajupadhyay29 24-Feb-11 7:06am    
I think you are trying to access data from two different databases by a single connection am I right?????

1 solution

Are you looking to link two databases? ie use a query that acesses tables from other databases?

If so all you need to do is to use a fully qualified name to call your table from the other database

select * from [databaseName].dbo.[tableName]


If your other database is on another server first you will have to link the servers then

select * from [serverName].[databaseName].dbo.[tableName]



I hope this help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900