473,385 Members | 1,720 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,385 software developers and data experts.

Index name conflict

i have a dts package that is going to run at night and pull data from
2 tables in an Oracle db and load it to 2 staging tables that my
package creates in sql server 2000. i then execute a few sprocs to
and columns, indexes, etc. after that all happens successfully i want
to delete the two production tables and rename the staging tables to
take their place.

the problem is that when i run the sproc to add the indexes,
constraints, etc i get an error because objects with the same name
exist on the 2 production tables. i can't delete the production
tables until the very last step. i thought about generating a random
number in my sproc and using it as the name of the index but that
seems crude and messy. any ideas?
Jul 20 '05 #1
2 2205
te********@yahoo.com (Ted Theodoropoulos) wrote in message news:<f5**************************@posting.google. com>...
i have a dts package that is going to run at night and pull data from
2 tables in an Oracle db and load it to 2 staging tables that my
package creates in sql server 2000. i then execute a few sprocs to
and columns, indexes, etc. after that all happens successfully i want
to delete the two production tables and rename the staging tables to
take their place.

the problem is that when i run the sproc to add the indexes,
constraints, etc i get an error because objects with the same name
exist on the 2 production tables. i can't delete the production
tables until the very last step. i thought about generating a random
number in my sproc and using it as the name of the index but that
seems crude and messy. any ideas?


It's not entirely clear from your email what your process is, but you
could use one set of names for the constraints etc. when they're on
the staging tables, then rename them after you rename the tables:

exec sp_rename 'StagingTable', 'ProductionTable'
exec sp_rename 'ProductionTable.StagingIndexName',
'ProductionIndexName', 'INDEX'
exec sp_rename 'StagingPrimaryKeyName', 'ProductionPrimaryKeyName',
'OBJECT'
etc.

If this isn't helpful, perhaps you could clarify the order of events
in your process, and give an example of where the names clash.

Simon
Jul 20 '05 #2
i fixed the problem by creating another database and naming it
[dbname]_staging. not very elegant but it works.
Jul 20 '05 #3

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

Similar topics

9
by: John | last post by:
I am using two large libraries which both have an implementation of a "matrix" class. I have the source code for both. I need to use them in the same project and when I try to compile I get a...
6
by: Ian Ribas | last post by:
Hello, This is probably a common problem, but I couldn't really find a direct answer in the archives (or maybe just couldn't find one that satisfied me ;-). I created an index specifically to...
17
by: Jeffrey W. Baker | last post by:
Greetings, I have a 23GB data table upon which I am building a primary key of three columns. The data is mounted in a 137GB device and pg_xlog is mounted on a separate 3.5GB device. I have...
9
by: Meendar | last post by:
Hi, Below is my code snippet having only one form, <form> <input type ="radio" name="action" value="xyz" checked>xyz <input type ="radio" name="action" value="zyx">zyx <input type ="radio"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.