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
 calling of user defined function throught another

Author  Topic 

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-25 : 03:36:53
it is possible to call a user defined function in another database...
can i transfer my trigger in my back up database..... and can i union my
table in another database file where have same field and datatype...

how will i do it???

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-25 : 03:37:51
Are there three questions?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-25 : 03:48:58
Yes.....

Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-02-25 : 03:55:03
it is possible to call a user defined function in another database...
yes u can select databasename.schema.functionname
can i union my table in another database table where have same field and datatype...
yes
select id from mytable
union
select id from database.schema.tablename
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-25 : 03:58:17
how about the trigger could i copy it in my back database.....
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-25 : 04:07:17
thanks of the help...

it so nice to be part of this forums....

i learn lots of thing..........

thank you so much guys....
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-02-25 : 04:43:12
welcome

u can create the trigger in ur back up database if it necessary........
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-25 : 09:23:23
if the databases are in same server, all the above can be done. however, if they happen to be in different server, you need to set up linked server connection among them before using the above solution.
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-25 : 20:30:08


i try the code in the house,but i encounter an error on schema...


im using ms sql server 2000
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-26 : 06:24:17
could somebody can help me figure out this problem???
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-26 : 06:47:34
you haven't specified what error...
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-26 : 06:51:49
schema error
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-27 : 03:55:26
i have encounter in 'schema' error...
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-02-27 : 04:06:15
try like this
servername.databasename.dbo.tablename
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-27 : 04:13:23
they were on the same server?....

ill try in the house because right now im on the cafe....

thanks for the reply....
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2009-02-27 : 04:14:32
more like "servername.databasename.dbo.tablename"
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-02-27 : 04:15:31
quote:
Originally posted by wormz666

they were on the same server?....

ill try in the house because right now im on the cafe....

thanks for the reply....



then no need of servername
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-27 : 04:18:05
Server: Msg 7202, Level 11, State 2, Line 1
Could not find server 'WKS27' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.

I get this error..
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-27 : 04:30:09
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.Northwind.Employees'.

i try to back up the northwind but i got this error.....

select * from dbo.mybackup.employees
union all
select * from dbo.Northwind.Employees

they have same attributes........


Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2009-02-27 : 04:32:59
Sorry i miss type your code..... i have got it.. thanks for the help..

i have learn so much........i got it now...
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-02-27 : 04:37:58
quote:
Originally posted by wormz666

Sorry i miss type your code..... i have got it.. thanks for the help..

i have learn so much........i got it now...


welcome
Go to Top of Page
    Next Page

- Advertisement -