Home Extract the name of a Database which is used in a view (refering other Database)
Reply: 0

Extract the name of a Database which is used in a view (refering other Database)

user527
1#
user527 Published in June 19, 2018, 6:20 pm

i dynamicaly create Views which refering other Databases (mainly to import data from there)

use [RezepteDB]

in this DB i create a view like this

CREATE VIEW [dbo].bla as select * from ZutatenDB.dbo.Bla

Later i need the name of the Database, on which is the view based.

For this example 'ZutatenDB'.

How can i done this? a small function to pass the name of the view and return the name of the database.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.367638 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO