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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to create more than one table from diff db

Author  Topic 

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-03-19 : 06:06:06
Hi all,

I have two db and one has history table, I want all the table
name ending up with name as history, to be created in other db.

Regards,
aak

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-03-19 : 06:12:23
Try this,

select * from sysobjects where xtype='u' and name like '%history'

But i don't know from a particular DB

Regards

Senthil.C
----------------------------------------------------------------------------
Server: Msg 3902, Level 16, State 1, Line 1
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-03-19 : 07:53:58
Thanks,

However this the select operation,
but I want to create them from sup db to super db.

Regards,
aak.

quote:
Originally posted by senthil_nagore

Try this,

select * from sysobjects where xtype='u' and name like '%history'

But i don't know from a particular DB

Regards

Senthil.C
----------------------------------------------------------------------------
Server: Msg 3902, Level 16, State 1, Line 1
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.


Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-03-19 : 08:24:42
Also I would like to create some of the stored proc
which is present in sup to super db.

rather than doing it manually one by one, is there any
sql stm in one shot.

regards,
aak


quote:
Originally posted by aakcse

Thanks,

However this the select operation,
but I want to create them from sup db to super db.

Regards,
aak.

quote:
Originally posted by senthil_nagore

Try this,

select * from sysobjects where xtype='u' and name like '%history'

But i don't know from a particular DB

Regards

Senthil.C
----------------------------------------------------------------------------
Server: Msg 3902, Level 16, State 1, Line 1
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.




Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-19 : 12:00:34
cant you use transfer database objects task of dts/ssis for this?
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-03-19 : 12:41:24
SSIS would be interesting to do, I have not done this before using SSIS.


Go to Top of Page
   

- Advertisement -