Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with UDF

Status
Not open for further replies.

gjmac2

IS-IT--Management
Mar 31, 2006
45
US
I am new to SQL, so please bear with me.

I am trying to copy a table from one database to another within enterprise manager. Would I use a custom view to copy the table of should I use a User Defined Function?

The database names at "DT" and "QA Reporting database". The name of the table I am trying to copy is "Case".

Any assistance would be much appreciated.
 
I suspect that the problem you are having is caused by the name of the table. CASE is a reserved word in SQL Server. As such, I would recommend you change the name.

Additionally, you could try...

Click Tools -> Query Analyzer

Copy/Paste this...

Code:
Select *
Into   [QA Reporting database].dbo.[case]
From   [DT].dbo.[case]



-George

"the screen with the little boxes in the window." - Moron
 
try somethign like this:

Code:
select * 
into TargetDatabase.dbo.Table1
from SourceDatabase.dbo.Table1

Remember if you create a table this way you will ned to recreate any indexes or constraints that existed on the previous table.

Hope this helps,

Alex

[small]----signature below----[/small]
I don't do any programming whatsoever

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top