Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Import Multiple Stored Procedures

Posted on 2004-08-02
12
Medium Priority
?
488 Views
Last Modified: 2008-03-06
Is there a way to import 50+ stored procedures from 1 database to another?

0
Comment
Question by:kyo3eb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 18

Accepted Solution

by:
SjoerdVerweij earned 500 total points
ID: 11697207
Sure. Enterprise Manager, Tools -> DTS -> Import Data, select the source database and destination database, then Transfer Objects. Uncheck "transfer all objects", click the button next to it, select the procedures, done.
0
 
LVL 1

Author Comment

by:kyo3eb
ID: 11698327
well, I've been trying for the past hour to do that but it keeps crashing, is there another way?
0
 
LVL 18

Expert Comment

by:SjoerdVerweij
ID: 11699119
Crashing how?

And yes, there's another way: right-click on the database in Enterprise Manager, All Tasks -> Generate SQL Scripts. Pick your procs, save it to a file, open that up in Query Analyzer, go to the destination database, run.
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 1

Author Comment

by:kyo3eb
ID: 11699242
well, not actually "crashing" per say, but when I click on "Select Object" nothing will happen, I've left it on for the past 30 minutes and still nothing, so I figured it crashed.
0
 
LVL 1

Author Comment

by:kyo3eb
ID: 11699319
ok, I have 2 problems

A) I tried using "Copy All Objects" and I get a failed to copy error

B) I can't use GENERATE SQL SCRIPT.. I get a ERROR 229: SELECT permission denied on object 'sysdatabases', database 'master', owner 'dbo'


Any other options before I start wasting time copying 1 by 1?

0
 
LVL 18

Expert Comment

by:SjoerdVerweij
ID: 11706310
A) don't copy them all, just select the stored procedures
B) you have to be an administrator to do this
0
 
LVL 1

Author Comment

by:kyo3eb
ID: 11706660
Like I said before, I've tried selecting the objects but Enterprise manager crashes/stalls.
0
 
LVL 18

Expert Comment

by:SjoerdVerweij
ID: 11707267
- Make sure to install SQL Server Service Pack 3a on both server and client
- What error do you get (if any)?
0
 
LVL 1

Author Comment

by:kyo3eb
ID: 11707917
the database source is from a hosting company so I assume they're up to date on patches, and the database target is from another hosting company (which is the development database) so I assume they're also up to date.

I don't get any errors when I click on "Select Objects", it just won't do anything and I can't do anything after that, not even click on the close button.

I called the hosting company that had the source data and they restricted access to the database for "security" reasons, we can't even use the designer wizard if we want to make changes to the tables, anything we want to do with changes have to be done using Query Analizer. On the target company, it's all normal.
0
 
LVL 1

Author Comment

by:kyo3eb
ID: 11708165
ok, I solved my problem, I had to highlight all of the SPs in the source DB and paste them in Query Analizer logged in to the target DB and paste them there, I ran the code and it created all of the SPs in the target DB.


Should've thought about that one a long time ago :@, I'm sure your first response will work for most of the users so I'll give you the points, didn't work for me 'cause of the stalling part.
0
 
LVL 18

Expert Comment

by:SjoerdVerweij
ID: 11708208
Can you explain the situation ask them to at least do a quick Grant Select On Master..SysDatabases To YourLogin?
0
 
LVL 1

Author Comment

by:kyo3eb
ID: 11708294
well, it seems they don't have a DBA on staff so they don't know how to properly set secure limits to the users, then again, I'm not a DBA either so I don't know what security ramifications can come from allowing users designer rights to a table.

On our other host we have designer rights, it makes our job as web developers a whole lot easier and time efficient.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question