473,383 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

SQL Server 2005 Import/Export not copying stored procedures

Hi,

In SQL 2000 if I wanted to take a complete copy of another running sql
database all did was create a new database locally and right-click it
and select import and point to another database and click copy
everything (stored procedures as well) and it did it for. I can't seem
to find the same functionality in SQL 2005. You can copy tables and
views but not the whole database. Is there another way of doing this?
Our SQL database is hosted externaly and they recommend using the
import/export feature to do it. Does anyone know I can copy everything
(such stored procedures, data table relations...etc)

Tanks
MA.

Apr 23 '06 #1
1 11997
(ma*******@gmail.com) writes:
In SQL 2000 if I wanted to take a complete copy of another running sql
database all did was create a new database locally and right-click it
and select import and point to another database and click copy
everything (stored procedures as well) and it did it for. I can't seem
to find the same functionality in SQL 2005. You can copy tables and
views but not the whole database. Is there another way of doing this?
Our SQL database is hosted externaly and they recommend using the
import/export feature to do it. Does anyone know I can copy everything
(such stored procedures, data table relations...etc)


You can try right-clicking the database and select Copy Database. Since
the source database appears to be located remotely you would have to use
the SMO method. Unfortunately, this method has plenty of problems, and I've
filed quite a few bug reports on it.

The best approach is to keep the source code for the database under
version control, so when you need a database, you build the database from
sources. To copy the data, you can easily generate BCP commands by
inquiring the system tables. For BCP out:

SELECT 'bcp somedb.' + schema_name(schema_id) + '.' + name +
' out ' + name + '.bcp -U user -P pw -S server -n'
FROM sys.tables

And BCP in:

SELECT 'bcp somedb.' + schema_name(schema_id) + '.' + name +
' in ' + name + '.bcp -T -S server -n ' +
CASE WHEN EXISTS (SELECT *
FROM sys.columns c
WHERE c.object_id = t.object_id
AND c.is_identity = 1)
THEN '-E'
ELSE ''
END
FROM sys.tables t
I've assumed there that you log into the remote host with SQL authentication
and use trusted connection at home.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Apr 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Karen | last post by:
SQL Server 2000 Ent, PowerBuilder 6.5 Ent, Window 2000 Pro Hi, My only experience is with Oracle,so please bear with me... We have some new clients that require our pricing data be imported...
8
by: Brendan Reynolds | last post by:
I'm trying to integrate SQL Server Reporting Services reports into an ASP.NET app (SRS 2000, ASP.NET 1.1). I know how to do this using direct URL addressing, but this exposes in the query string...
3
by: Iavor Raytchev | last post by:
Hello, We a situation with a central database that contains the data that needs to be presented at N off-line terminals (N can be 5 000 can be 15 000). Each terminal presents unique data. The...
1
by: Maricel Espejo | last post by:
Hi, Is there anyone encountered this error before & how it is being resolved? Missing end comment mark '*/' The error pops-up when I was running a DTS Import/Export from a SQL server...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
1
by: info.nrieger | last post by:
Hello, I'm not very familiar to SQL Server, but I've to upgrade a DBMS from V6.5 to V2005. the same, at least it has the same size). After installing V2005 - at another system - I could not...
15
by: Wes Groleau | last post by:
When I try to import from Access, the DTS wizard only allows me to import tables and queries. OK, I'm not surprised the "macros" and reports don't come over. But it executes each query, and...
1
by: BalajiJaganathan | last post by:
When iam trying to execute a dts package i got the following error - Copying to .. (Error) Messages Information 0x402090df: Data Flow Task: The final commit for the data insertion has started. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.