Showing posts with label stored. Show all posts
Showing posts with label stored. Show all posts

Wednesday, March 21, 2012

Moving Stored Procedures in SQL 6.5 to 2000

Hi All

How do I export/copy the stored procdures I have on SQL Server 6.5 to my new SQL 2000 installation?

Are there any big (or small) differences I need to know about between the two installations with regard to Stored Procedures?

Many Thanks

TaddubThe easiest way would be to script them from 6.5, you are probably going to have to change a fair amount to get them to perform well.

-Euansql

Moving Stored Procedures

CAN ANYONE TEL ME THE BEST WAY TO MOVE STORED PROCEDURES FROM THE master DATABASE ON ONE SERVER TO THE master DATABASE ON ANOTHER SERVER ?
ARE THERE ANY SPECIAL CONSIDERATIONS TO BEAR IN MIND WITH IT BEING THE master DATABASE ?
THANKS FOR YOUR HELPThis sounds familiar - you wouldn't be posting on multiple sites would you?

When you install sql server all the system stored procedures should be created.
If you have place user stored procedures in master then maybe you should consider whether it is a good ideas.

Moving is same as any other dtabase - just script them off and apply the script to the destination. Easy if you keep the scripts in SourceSafe which I would recommend.

Moving stored procedures

We are moving an existing database to a new dedicated server. Is there a
way to copy all the user defined stored procedures? If so, what is it.
TIA
Michael
If you are using the backup and restore method to move the databases, the stored procedures are copied right along with the databases. I'm working on an identical project and that works fine for me. You can also use a DTS package with the copy database
feature.
"Michael Beck" wrote:

> We are moving an existing database to a new dedicated server. Is there a
> way to copy all the user defined stored procedures? If so, what is it.
> TIA
> Michael
>
>
|||You could also to sp_detach_db and sp_attach_db... in all 3 cases your
stored procedures will move with the database. They are stored inside the
database in a table called syscomments.,,, so they go automatically.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Michael Beck" <Mikeb46NoSpam@.pacbell.net> wrote in message
news:ewxJ38FZEHA.3228@.TK2MSFTNGP12.phx.gbl...
> We are moving an existing database to a new dedicated server. Is there a
> way to copy all the user defined stored procedures? If so, what is it.
> TIA
> Michael
>

Moving stored procedures

We are moving an existing database to a new dedicated server. Is there a
way to copy all the user defined stored procedures? If so, what is it.
TIA
MichaelIf you are using the backup and restore method to move the databases, the st
ored procedures are copied right along with the databases. I'm working on a
n identical project and that works fine for me. You can also use a DTS pack
age with the copy database
feature.
"Michael Beck" wrote:

> We are moving an existing database to a new dedicated server. Is there a
> way to copy all the user defined stored procedures? If so, what is it.
> TIA
> Michael
>
>|||You could also to sp_detach_db and sp_attach_db... in all 3 cases your
stored procedures will move with the database. They are stored inside the
database in a table called syscomments.,,, so they go automatically.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Michael Beck" <Mikeb46NoSpam@.pacbell.net> wrote in message
news:ewxJ38FZEHA.3228@.TK2MSFTNGP12.phx.gbl...
> We are moving an existing database to a new dedicated server. Is there a
> way to copy all the user defined stored procedures? If so, what is it.
> TIA
> Michael
>

Moving stored procedures

We are moving an existing database to a new dedicated server. Is there a
way to copy all the user defined stored procedures? If so, what is it.
TIA
MichaelYou could also to sp_detach_db and sp_attach_db... in all 3 cases your
stored procedures will move with the database. They are stored inside the
database in a table called syscomments.,,, so they go automatically.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Michael Beck" <Mikeb46NoSpam@.pacbell.net> wrote in message
news:ewxJ38FZEHA.3228@.TK2MSFTNGP12.phx.gbl...
> We are moving an existing database to a new dedicated server. Is there a
> way to copy all the user defined stored procedures? If so, what is it.
> TIA
> Michael
>

Monday, March 12, 2012

Moving SQL 7 DB to different machine SQL2000

have a SQL 7 db with stored procedures and tables and have to move it to another box with SQL2000, what is the cleanest way to do this? backup and restore?

take the complete backup of database, creat a new database on the new system with same name, and select restore database ,select the backup file for restoring. you will have to take care for the paths of the mdf and ldf file (will need to change it manually for the current backup file path). also check the "force restore" check box. I think its the right name for the check box as I don't have sql server on my system now.

your database will be moved fully and in very quick time.

Usman

|||

Thank You for the quick repsonse but i do have some more questions.

1. Will the stored procedures move correctly? especially going from 7 to 2000?

2. Also, when the DB is restored will it upgrade the DB and the stored Procedures

3. Is there an issue with the files being on differnt drives/directories?

|||

2000 should detect that the mdf and ldf belong to older version of MSSQL and will ask if you want to convert to newer version code.

BEAWARE******But there are chances that you might see some change in functionality******

Friday, March 9, 2012

Moving Source

Hi,

At a high level, this is what I need to do in a stored procedure:

CREATE VIEW TEMP_VIEW AS
SELECT * FROM SOURCE_XLS...Sheet1$

-the reason for creating the view is that the number of columns in Sheet1$ is not static.
By creating the view, I then can determine with sysobject/syscolumns how many columns I have to process for each row.

DECLARE my_cursor CURSOR
FOR SELECT * FROM TEMP_VIEW

OPEN my_cursor
DECLARE ? ?
FETCH NEXT FROM my_cursor INTO ??
WHILE <etc>
DO STUFF WITH EACH COLUMN IN THAT ROW (as noted above, this will never be a static list of columns)
END
CLOSE my_cursor
DEALLOCATE my_cursor

so, Im obviously stuck on what Im going to fetch my_cursor into. Am I limited to scalar types?

and, inside the WHILE loop, can I refer to the columns by their index (i.e. which column number they are in the result set as opposed to the name)

or is it back to the drawing board for a completely different approach.

Thanks for any input.

Cheers,
David.came up with a better approach...ignore the above.|||Very good!

-PatP

Wednesday, March 7, 2012

Moving of Stored Procedures

Need a little advice,
I am creating an application, created two databases, one for building
the app. And the other is for when it is running. Is there a simple way
of copying the stored procedures to the one that i will be running the
app on? All the tables and columns are named the same in both.
Tom
*** Sent via Developersdex http://www.codecomments.com ***
We migrate the sp with custom made table and sp.
We have table with 'from server', 'To Server', 'sp_name' and' permission'
information, which I populate for any sp migration using bcp. This table and
script can differ depending on your needs.
We also use a script that is built around sp_helptext, which can create the
drop sp statement, and script and permission. This is only useful if you do
extensive version control. Please let me know if you found and easier way to
deal with this.
Sam
|||You can simply script out the stored procedures using Enterprise Manager by
right clicking on the db, going to all tasks then generate scripts. Take
that script(s) and run it on the other database via query analyzer. You can
also invest a few dollars into a tool from www.red-gate.com that will
compare the two db's and tell you want is different. It will also generate
the scripts to make them both the same. It's really worth the few hundred
dollars if you do this often.
Andrew J. Kelly SQL MVP
"Thomas Beyerlein" <tbxml@.yahoo.com> wrote in message
news:%23C7dnX%23NGHA.1676@.TK2MSFTNGP09.phx.gbl...
> Need a little advice,
> I am creating an application, created two databases, one for building
> the app. And the other is for when it is running. Is there a simple way
> of copying the stored procedures to the one that i will be running the
> app on? All the tables and columns are named the same in both.
> Tom
>
> *** Sent via Developersdex http://www.codecomments.com ***

Moving of Stored Procedures

Need a little advice,
I am creating an application, created two databases, one for building
the app. And the other is for when it is running. Is there a simple way
of copying the stored procedures to the one that i will be running the
app on? All the tables and columns are named the same in both.
Tom
*** Sent via Developersdex http://www.developersdex.com ***We migrate the sp with custom made table and sp.
We have table with 'from server', 'To Server', 'sp_name' and' permission'
information, which I populate for any sp migration using bcp. This table and
script can differ depending on your needs.
We also use a script that is built around sp_helptext, which can create the
drop sp statement, and script and permission. This is only useful if you do
extensive version control. Please let me know if you found and easier way to
deal with this.
Sam|||You can simply script out the stored procedures using Enterprise Manager by
right clicking on the db, going to all tasks then generate scripts. Take
that script(s) and run it on the other database via query analyzer. You can
also invest a few dollars into a tool from www.red-gate.com that will
compare the two db's and tell you want is different. It will also generate
the scripts to make them both the same. It's really worth the few hundred
dollars if you do this often.
--
Andrew J. Kelly SQL MVP
"Thomas Beyerlein" <tbxml@.yahoo.com> wrote in message
news:%23C7dnX%23NGHA.1676@.TK2MSFTNGP09.phx.gbl...
> Need a little advice,
> I am creating an application, created two databases, one for building
> the app. And the other is for when it is running. Is there a simple way
> of copying the stored procedures to the one that i will be running the
> app on? All the tables and columns are named the same in both.
> Tom
>
> *** Sent via Developersdex http://www.developersdex.com ***

Moving of Stored Procedures

Need a little advice,
I am creating an application, created two databases, one for building
the app. And the other is for when it is running. Is there a simple way
of copying the stored procedures to the one that i will be running the
app on? All the tables and columns are named the same in both.
Tom
*** Sent via Developersdex http://www.codecomments.com ***We migrate the sp with custom made table and sp.
We have table with 'from server', 'To Server', 'sp_name' and' permission'
information, which I populate for any sp migration using bcp. This table and
script can differ depending on your needs.
We also use a script that is built around sp_helptext, which can create the
drop sp statement, and script and permission. This is only useful if you do
extensive version control. Please let me know if you found and easier way t
o
deal with this.
Sam|||You can simply script out the stored procedures using Enterprise Manager by
right clicking on the db, going to all tasks then generate scripts. Take
that script(s) and run it on the other database via query analyzer. You can
also invest a few dollars into a tool from www.red-gate.com that will
compare the two db's and tell you want is different. It will also generate
the scripts to make them both the same. It's really worth the few hundred
dollars if you do this often.
Andrew J. Kelly SQL MVP
"Thomas Beyerlein" <tbxml@.yahoo.com> wrote in message
news:%23C7dnX%23NGHA.1676@.TK2MSFTNGP09.phx.gbl...
> Need a little advice,
> I am creating an application, created two databases, one for building
> the app. And the other is for when it is running. Is there a simple way
> of copying the stored procedures to the one that i will be running the
> app on? All the tables and columns are named the same in both.
> Tom
>
> *** Sent via Developersdex http://www.codecomments.com ***