PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.setup > sql 2005.. exporting stored procedures from one DB to another
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
ms.sqlserver.setup Questions about SQL Server.

sql 2005.. exporting stored procedures from one DB to another

Réponse
 
LinkBack Outils de la discussion
Vieux 14/04/2008, 04h13   #1
markm75
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut sql 2005.. exporting stored procedures from one DB to another

I've never dealt with stored procedures much.. but i have a new database
created.. imported the tables, but the stored procedures didnt get copied
over..

Is there an easy way to export them.. perhaps to a .sql file ... then import
them or run a script on the other database..

I have never done much with the query window before, so i'm not sure how to
handle this.. as there are around 20 stored procedures that need imported..

Thanks for any tips...


  Réponse avec citation
Vieux 14/04/2008, 04h28   #2
Brett I. Holcomb
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sql 2005.. exporting stored procedures from one DB to another

Did you just import tables? There may be another way but if you
backed up the old database, then restored it to the new one the sps
would come with it.

On Sun, 13 Apr 2008 19:13:00 -0700, markm75
<markm75@discussions.microsoft.com> wrote:

>I've never dealt with stored procedures much.. but i have a new database
>created.. imported the tables, but the stored procedures didnt get copied
>over..
>
>Is there an easy way to export them.. perhaps to a .sql file ... then import
>them or run a script on the other database..
>
>I have never done much with the query window before, so i'm not sure how to
>handle this.. as there are around 20 stored procedures that need imported..
>
>Thanks for any tips...
>

  Réponse avec citation
Vieux 14/04/2008, 05h23   #3
markm75
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sql 2005.. exporting stored procedures from one DB to another



"Brett I. Holcomb" wrote:

> Did you just import tables? There may be another way but if you
> backed up the old database, then restored it to the new one the sps
> would come with it.
>
> On Sun, 13 Apr 2008 19:13:00 -0700, markm75
> <markm75@discussions.microsoft.com> wrote:
>
> >I've never dealt with stored procedures much.. but i have a new database
> >created.. imported the tables, but the stored procedures didnt get copied
> >over..
> >
> >Is there an easy way to export them.. perhaps to a .sql file ... then import
> >them or run a script on the other database..
> >
> >I have never done much with the query window before, so i'm not sure how to
> >handle this.. as there are around 20 stored procedures that need imported..
> >
> >Thanks for any tips...
> >

>


With the setup i'm dealing with.. i dont think its possible to "restore"
dbs.. its through a web hosting service.. unfortunately.


  Réponse avec citation
Vieux 14/04/2008, 09h17   #4
Ekrem Önsoy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sql 2005.. exporting stored procedures from one DB to another

Open SSMS and connect to your SQL Server instance where you develope your
Stored Procedures and then Open a New Query for your database in your
hosting company. Find your Stored Procedures on your developement instance,
right click on your SP and then from the popup menu, choose "Script Stored
Procedure as" and then "Create to" and "Clipboard". Then, go to the Query
window (that you opened for your remote instance) and then paste the SP and
then run it. (You may need to change the Schema or something according to
your application and environment)

--
Ekrem Önsoy




"markm75" <markm75@discussions.microsoft.com> wrote in message
news:EAC8E1A4-57C3-4437-97B1-9D3724C05F19@microsoft.com...
>
>
> "Brett I. Holcomb" wrote:
>
>> Did you just import tables? There may be another way but if you
>> backed up the old database, then restored it to the new one the sps
>> would come with it.
>>
>> On Sun, 13 Apr 2008 19:13:00 -0700, markm75
>> <markm75@discussions.microsoft.com> wrote:
>>
>> >I've never dealt with stored procedures much.. but i have a new database
>> >created.. imported the tables, but the stored procedures didnt get
>> >copied
>> >over..
>> >
>> >Is there an easy way to export them.. perhaps to a .sql file ... then
>> >import
>> >them or run a script on the other database..
>> >
>> >I have never done much with the query window before, so i'm not sure how
>> >to
>> >handle this.. as there are around 20 stored procedures that need
>> >imported..
>> >
>> >Thanks for any tips...
>> >

>>

>
> With the setup i'm dealing with.. i dont think its possible to "restore"
> dbs.. its through a web hosting service.. unfortunately.
>
>


  Réponse avec citation
Vieux 14/04/2008, 20h06   #5
markm75
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sql 2005.. exporting stored procedures from one DB to another



"Ekrem Önsoy" wrote:

> Open SSMS and connect to your SQL Server instance where you develope your
> Stored Procedures and then Open a New Query for your database in your
> hosting company. Find your Stored Procedures on your developement instance,
> right click on your SP and then from the popup menu, choose "Script Stored
> Procedure as" and then "Create to" and "Clipboard". Then, go to the Query
> window (that you opened for your remote instance) and then paste the SP and
> then run it. (You may need to change the Schema or something according to
> your application and environment)
>
> --
> Ekrem Önsoy
>
>
>
>
> "markm75" <markm75@discussions.microsoft.com> wrote in message
> news:EAC8E1A4-57C3-4437-97B1-9D3724C05F19@microsoft.com...
> >
> >
> > "Brett I. Holcomb" wrote:
> >
> >> Did you just import tables? There may be another way but if you
> >> backed up the old database, then restored it to the new one the sps
> >> would come with it.
> >>
> >> On Sun, 13 Apr 2008 19:13:00 -0700, markm75
> >> <markm75@discussions.microsoft.com> wrote:
> >>
> >> >I've never dealt with stored procedures much.. but i have a new database
> >> >created.. imported the tables, but the stored procedures didnt get
> >> >copied
> >> >over..
> >> >
> >> >Is there an easy way to export them.. perhaps to a .sql file ... then
> >> >import
> >> >them or run a script on the other database..
> >> >
> >> >I have never done much with the query window before, so i'm not sure how
> >> >to
> >> >handle this.. as there are around 20 stored procedures that need
> >> >imported..
> >> >
> >> >Thanks for any tips...
> >> >
> >>

> >
> > With the setup i'm dealing with.. i dont think its possible to "restore"
> > dbs.. its through a web hosting service.. unfortunately.
> >
> >

>



Thanks for the tip.. i actually tried this but it didnt quite work..



Just some more background maybe i should have included.. i think these
missing stored procedures are related to the asp.net 2.0 provider features..
i think the db was originally sql 2000 (i cant recall where some of these
came from: ie: sp's like dbo.aspnet_Membership_CreateUser or
dbo.aspnet_CheckSchemaVersion;



So in the dedicated server's sql 2005 db.. i created a new DB, migrated the
tables over..



I tried doing the above steps but had an error on, for instance, the
checkschemaversion one:

Could not locate entry in sysdatabases for database 'TestDB'. No entry found
with that name. Make sure that the name is entered correctly.



I think a step may be missing or maybe i need to change the way i executed
the query on the new DB.

  Réponse avec citation
Vieux 14/04/2008, 20h34   #6
markm75
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sql 2005.. exporting stored procedures from one DB to another



"Ekrem Önsoy" wrote:

> Open SSMS and connect to your SQL Server instance where you develope your
> Stored Procedures and then Open a New Query for your database in your
> hosting company. Find your Stored Procedures on your developement instance,
> right click on your SP and then from the popup menu, choose "Script Stored
> Procedure as" and then "Create to" and "Clipboard". Then, go to the Query
> window (that you opened for your remote instance) and then paste the SP and
> then run it. (You may need to change the Schema or something according to
> your application and environment)
>
> --
> Ekrem Önsoy
>
>
>
>
> "markm75" <markm75@discussions.microsoft.com> wrote in message
> news:EAC8E1A4-57C3-4437-97B1-9D3724C05F19@microsoft.com...
> >
> >
> > "Brett I. Holcomb" wrote:
> >
> >> Did you just import tables? There may be another way but if you
> >> backed up the old database, then restored it to the new one the sps
> >> would come with it.
> >>
> >> On Sun, 13 Apr 2008 19:13:00 -0700, markm75
> >> <markm75@discussions.microsoft.com> wrote:
> >>
> >> >I've never dealt with stored procedures much.. but i have a new database
> >> >created.. imported the tables, but the stored procedures didnt get
> >> >copied
> >> >over..
> >> >
> >> >Is there an easy way to export them.. perhaps to a .sql file ... then
> >> >import
> >> >them or run a script on the other database..
> >> >
> >> >I have never done much with the query window before, so i'm not sure how
> >> >to
> >> >handle this.. as there are around 20 stored procedures that need
> >> >imported..
> >> >
> >> >Thanks for any tips...
> >> >
> >>

> >
> > With the setup i'm dealing with.. i dont think its possible to "restore"
> > dbs.. its through a web hosting service.. unfortunately.
> >
> >

>





Actually.. i take that back.. it did work.. i had that error.. but all the
stored procedures were there.. thanks again for that tip!




  Réponse avec citation
Vieux 14/04/2008, 21h52   #7
Ekrem Önsoy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sql 2005.. exporting stored procedures from one DB to another

Probably that problematic SP contains some commands that related to TestDB
database and as it's not exist in your database which is at your hosting
company' s server, the copied script does not work to create that SP in the
remote server.

Check your codes in that problematic SP and make sure you do not \ do have
that database in the remove server.

I'm glad things worked for ya!

--
Ekrem Önsoy


"markm75" <markm75@discussions.microsoft.com> wrote in message
news:B89AA0A0-EEB6-4088-8961-473F0DAC4BA5@microsoft.com...
>
>
> "Ekrem Önsoy" wrote:
>
>> Open SSMS and connect to your SQL Server instance where you develope your
>> Stored Procedures and then Open a New Query for your database in your
>> hosting company. Find your Stored Procedures on your developement
>> instance,
>> right click on your SP and then from the popup menu, choose "Script
>> Stored
>> Procedure as" and then "Create to" and "Clipboard". Then, go to the Query
>> window (that you opened for your remote instance) and then paste the SP
>> and
>> then run it. (You may need to change the Schema or something according to
>> your application and environment)
>>
>> --
>> Ekrem Önsoy
>>
>>
>>
>>
>> "markm75" <markm75@discussions.microsoft.com> wrote in message
>> news:EAC8E1A4-57C3-4437-97B1-9D3724C05F19@microsoft.com...
>> >
>> >
>> > "Brett I. Holcomb" wrote:
>> >
>> >> Did you just import tables? There may be another way but if you
>> >> backed up the old database, then restored it to the new one the sps
>> >> would come with it.
>> >>
>> >> On Sun, 13 Apr 2008 19:13:00 -0700, markm75
>> >> <markm75@discussions.microsoft.com> wrote:
>> >>
>> >> >I've never dealt with stored procedures much.. but i have a new
>> >> >database
>> >> >created.. imported the tables, but the stored procedures didnt get
>> >> >copied
>> >> >over..
>> >> >
>> >> >Is there an easy way to export them.. perhaps to a .sql file ... then
>> >> >import
>> >> >them or run a script on the other database..
>> >> >
>> >> >I have never done much with the query window before, so i'm not sure
>> >> >how
>> >> >to
>> >> >handle this.. as there are around 20 stored procedures that need
>> >> >imported..
>> >> >
>> >> >Thanks for any tips...
>> >> >
>> >>
>> >
>> > With the setup i'm dealing with.. i dont think its possible to
>> > "restore"
>> > dbs.. its through a web hosting service.. unfortunately.
>> >
>> >

>>

>
>
> Thanks for the tip.. i actually tried this but it didnt quite work..
>
>
>
> Just some more background maybe i should have included.. i think these
> missing stored procedures are related to the asp.net 2.0 provider
> features..
> i think the db was originally sql 2000 (i cant recall where some of these
> came from: ie: sp's like dbo.aspnet_Membership_CreateUser or
> dbo.aspnet_CheckSchemaVersion;
>
>
>
> So in the dedicated server's sql 2005 db.. i created a new DB, migrated
> the
> tables over..
>
>
>
> I tried doing the above steps but had an error on, for instance, the
> checkschemaversion one:
>
> Could not locate entry in sysdatabases for database 'TestDB'. No entry
> found
> with that name. Make sure that the name is entered correctly.
>
>
>
> I think a step may be missing or maybe i need to change the way i executed
> the query on the new DB.
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h25.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,20116 seconds with 15 queries