Copy Tables Containing Refrential Integrity
Apr 3, 2008
Hi ..
This is chetan jain DBA sql server..
i want to know that...
1.can i move some tables of database through DTS to another server having refrential integrity ( source tables have refrential integrity)????
Thanks in advance.
-- Chetan
View 3 Replies
ADVERTISEMENT
Oct 12, 2004
I have a lookup table called States, I have multiple other tables that use this lookup table, but I can only relate to one other table. My question is if I change a state name how do I enforce that change to the other tables that CANT be related? I know it is a design flaw and need some kind of joining table. I am having difficulty understanding and incorporating first normal form in my database. Here is what i have so far.
Example:
Table 1
========|============|=============|========|
CustomerID BillingAddressID ShippingAddressID OtherFields
========|============|=============|========|
Table 2
===========|======|========|
BillingAddressID StateID OtherFields
===========|======|========|
Table 3
=============|======|========|
ShippingAddressID StateID OtherFields
=============|======|========|
Table 4
======|====|
StateID Name
======|====|
How do I relate table 4 with table 2 & 3 for referential integrity? Or create a joiner table?
View 7 Replies
View Related
Jun 4, 2008
Hi everyone,
I have recently converted my DTS packages to SSIS and deployed them to the new server. I have the 2000 and 2005 server running concurrently, all that is left for me to do is compare the the tables generated by the DTS and SSIS packages to see if they are the same.
How do I go about comparing the tables, which are from two different servers using SQL server 2005?
Thank you inadvance:)
Comparing data and integrity between two tables
View 2 Replies
View Related
Apr 30, 2008
Hi all,
I am writing a portion of an app that is of intensely high online eCommerce usage. I have a question about identity columns and locking or not.
What I am doing is, I have two tables (normalized), one is OrderDemographics(firstname,lastname,ccum,etc) the other is OrderItems. I have the primary key of OrderDemographics as a column called 'ID' (an Identity Integer that is incrementing). In the OrderItems table, the 'OrderID' column is a foreign key to the OrderDemographics Primary Key column 'ID'.
What I have previously done is to insert the demographics into OrderDemographics, then do a 'select top 1 ID from OrderDemographics order by ID DESC' to get that last ID, since you can't tell what it is until you add another row....
The problem is, there's up to 20,000 users/sessions at once and there is a possiblity that in the fraction of a second it takes to select back that ID integer and use it for the initial OrderItems row, some other user might have clicked 'order' a fraction of a second after the first user and created another row in OrderDemographics, thus incrementing the ID column and throwing all the items that Customer #1 orders into Customer #2's order....
How do I lock a SQL table or lock the Application in .NET to handle this problem and keep it from occurring?
Thanks, appreciate it.
View 2 Replies
View Related
Mar 3, 2006
I have transaction table where the rows entered into the transactioncan come a result of changes that take place if four different tables.So the situation is as follows:Transaction Table-TranId-Calc AmountTable 1 (the amount is inserted into the transaction table)- Tb1Id- Tb1AmtTable 2 (an amount is calculated based on the percentage and insertedinto the transaction table)-Tbl2Id-Tb2PercentageTable 3 (the amount is inserted into the transaction table)-Tbl3Id-Tbl3AmutTable 4 (an amount is calculated based on the percentage and insertedinto the transaction table. )-Tbl2Id-Tb2PercentageHow do I create referential integrity between the Transaction table andthe rest of the tables. When I make changes to the values in Table 1 -4, I need to be able to reflect this in the Transaction table.Thanks.
View 6 Replies
View Related
May 26, 2007
I have a table that I am basically reduplicating a couple of times for each part of this database that I want to create.Each table basically has the same data: The tables will be called motherTable, fatherTable, sonTable, daughterTable and so on.I am pretty much using the following in each column: UserID, MotherID(or FatherID or SonID, etc., etc. and so on for each unique table), FirstName, LastName, MiddleName, BirthPlace, Photo, Age.I don't see an option to copy a table and just modify the second ID part and rename that table accordingly.How can I make this an easier way of creating these similar tables without retyping all these columns over and over again?Thanks in advance.
View 4 Replies
View Related
Aug 14, 2015
I need to copy data from warehouse tables to master tables of different SQL instances. Refresh need to done once in an hour. What is the best way to do this? SQL agent jobs or SSIS packages?
View 3 Replies
View Related
Feb 10, 2007
Is there anyway I can copy tables and stored procedures from one MS SQL server database to another? I presume there is, so how is it done.Thanks
View 6 Replies
View Related
Oct 3, 2007
I have two databases and want to copy tables (with table data) and stored procedures from one database to another.both databases have the same name (so management studio is not letting me have both up)....what should I do?thanks.
View 5 Replies
View Related
Apr 1, 2002
What is the easiest way for me to copy my database tables so that I could use the copy as a template to work on for setting primary keys, and normalizing the data?
Thank you in advance for your help.
Shari
View 1 Replies
View Related
Aug 6, 2002
A question from a beginner. Is there a simple command to create a copy of at table with its original attributes. I would like to take a table for a year and copy it to an archive file with the year appended to the name, i.e. myfile copied to myfile02
View 1 Replies
View Related
Dec 10, 2000
I need a job to copy data between 2 databases on the same server. (2nd one will be used for reporting purposes, and I'll run my job nightly)
Can anyone at least point me in the right direction for Transact-SQL statements or which process to start with.
I tried a DTS job but it fails on the schedule. Only runs immediatly but then fails.
Thanks..
View 1 Replies
View Related
Apr 15, 2005
Hello all
I have a table named Configuration and I want to make a copy of this table.
I already have the table with the same structure named Configuration1. All I want to do is copy data from Configuration to Configuration1
How do I do it? I tried various queries:
SELECT *
INTO configuration1
FROM configuration
GO
Results:
(395 row(s) affected) but configuration1 is empty.
----------------------
Create configuration1 like configuration
Results:
Error near like
------------------------
So how do i achieve this?
Thanks much guys/girls....
View 2 Replies
View Related
Sep 12, 2006
Hi
I have a DB2 database server.It has 2000+ tables...And I have a MS SQL database server.It has got the same tables.With same schema...
I want to take all of that tables datas to MS Sql database's tables....
I try to use DTS Import Data Wİzard but it gace an erro which is Unknown Error!!!
Now;
I try to make a DTS which is capable with doing this mission...
I want to create one DTC package and the source table and destination table names will be changed dynamically...Probably i should use ActiveX Task or Dynamic PropertTask...
Despite i have searched from net very much i couldnt find any helpfull article or sample for 3 days...I have also checked this one;
http://www.sqldts.com/default.aspx?246
But it hasnt helped me too..
I really wish thatsomebody can help me...
Thank u all
Osman AYHAN
View 5 Replies
View Related
Dec 7, 2007
Hi everyone!
I want to copy from DB certain tables to an other DB. How can I do that with SQL Server 2005. I would prefer an SQL string solution instead of buttonclicking solution.
Thanks a lot and greetings from Vienna, Austria
landau
View 6 Replies
View Related
Apr 22, 2004
Hi,
I have 2 databases and each of them has different tables. I want to copy all of tables of database A to database B while keeping the existing tables of database B.
What is the best solution?
Thanks
View 3 Replies
View Related
Nov 2, 2001
I need to duplicate all the tables owned by dbo to another object ownername in a database within the same database.That means,if there are 100 table owned by dbo in a 'Database A'. I need to have a total of 200 tables in the same database 100 each for dbo and 100 for another user.They should have same schema including the keys etc and data.How is this possible?Through DTS we can't copy them to the same databse.We do not want to have a temp db inbetween to complete this process.Any ideas on how to do this? NOTE:This is not a one time job.
Thanks.
Sheila.
View 1 Replies
View Related
Feb 4, 2005
I want to make a copy of a table and this table has several constraints and
I would like to keep all of them
How should I do it? Thank you
View 1 Replies
View Related
Aug 24, 2006
I need to copy the data in the last name table to the field2 table do i use the update query in sql 2005?
View 5 Replies
View Related
May 17, 2015
copy the tables of a database that will keep the indexes,constraints etc.? I'll be using SQL 2008 or Visual Studio 2008. The basic SSIS package will not work since our databases are being updated from time to time. (e.g. new columns/tables meaning we need to redo the SSIS package everytime there are changes).
View 4 Replies
View Related
Mar 1, 2006
how can i copy all table and data to another database
View 3 Replies
View Related
Dec 26, 2006
I need to construct a database that only has certain elements of another db. I would like to write one batch of commands to either create the tables or update them if the table already exists. I've found examples to update sections of a table, but not the entire thing. Any assistance or relavent links are greatly appreciated.
Thanks,
View 1 Replies
View Related
Dec 26, 2006
I need to construct a database that only has certain elements of another db. I would like to write one batch of commands to either create the tables or update them if the table already exists. I've found examples to update sections of a table, but not the entire thing. Any assistance or relavent links are greatly appreciated.
Thanks,
View 1 Replies
View Related
Mar 31, 2007
Hi everyone
I have 2 severs. I want to copy 3 tables (data, table definition, inex..ect) from sever A to sever B.
What is the best way to do it?
Please help!
View 1 Replies
View Related
Dec 13, 2007
Hi All
[i am fairly new to SSIS]
My current project copies source tables to destination tables. Structure at both sides is identical so it€™s kinda €˜repetitive€™ process to drag source and destination components.
So I want to create component which should do following €“
select source connection
select source tables
select destination connection
select all destination table
map source table to destination table
validate columns mapping based on the names
To enhance, I also would like to support creation and mapping of custom values.
So I would really appreciate any kind of input in creating this component. Currently I am reading tutorials on creating SSIS components.
Thanks in advance
View 1 Replies
View Related
Sep 13, 2007
I need to 'copy' selective (filtered) rows from table 'A' to table 'B' on a regular basis, but only if they do not exist in table 'B'.
If rows get deleted from table 'A' they must remain table 'B'. If rows change in table 'A' (unlikely) they should be update in table 'B'
What feature of SQL should I be using?
- triggerering a stored procedure on Insert
- replication
- SSIS
View 1 Replies
View Related
Feb 22, 2007
Goodday
Can anyone help please.
I have made a database and need to duplicate the tables to represent new catogaries. The definitions in the tables will stay the same , just the table names will change.
Is there a way to copy and past / duplicate tables without retyping all the definitions each time.
Thanks
Rob
View 1 Replies
View Related
Apr 18, 2006
Hi!
Can someone tell me how I can copy my database which is made with SQLExpress or the tables to another SQL server. The servers could be SQL server 2000 and SQLExpress.
Thanks!
View 5 Replies
View Related
Mar 5, 2008
I have 3 tables(Table1, Table2, Table3) and i want this 3 tables to be inserted/copied to NewTable.
this is my query and it is good only for one table:
INSERT INTO NewTable
SELECT *
FROM Table1;
Can you help me to solve this problem?
Thanks....
View 2 Replies
View Related
Feb 21, 2007
Hi there;
i've recently designed a new db for my portal website, and wanna move
the old data from former db to the new one. The problem is that
for the 'News' table, for instance i have two different schemas:Old >>News(id,title,summery,text,date, ... , (old columns) , ...)New >> News(id, title , summery , text , date, lastUpdated, ... , (new columns) , ...) i
want to copy the bolded columns, and want to have 'lastUpdated' &
'date' in the new table to be the same as 'date' in the former one.as i googled, i just found materials on copying dbs to production servers, or cross db scenarios. thanks in advance
View 3 Replies
View Related
Feb 14, 2008
hi I'm working in VS2005 with SQL server Express database.How can I copy some tables, stored procedures and diagrams from one database to another? thanks
View 3 Replies
View Related
May 1, 2005
Hi,
whats the best way to copy a table from sql server 2005 to 2000?
Thanks for any help...
View 3 Replies
View Related
Jan 20, 2006
I found a nice demo of using AJAX here
http://weblogs.asp.net/scottgu/archive/2005/12/26/433997.aspx
and want to use some of the code in my own website. But it uses a SQL DB and tables.
So without recreating thme manually what is the way to get these tables in MY DB?
View 2 Replies
View Related