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
HI, Is it possible in SQL Server to restore Databases partially? In the sense, I want to backup just 2 tables from a database & restore them, instead of having to take a backup of the entire database & restore the entire database.
One way to do would be to export data & then importing data for only those selective tables, but I dont want to do that, bcause that would probably take more time & can be error prone.
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.
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?
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.
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?
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
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
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.
Hi. I have a SQL statement currently ending with "ORDER BY sc.TypeID, sc.ObjetID DESC"where the TypeID can be of value 1,2,3,4,5,6,7,8, 9 and 10. What I would like to achieve is to selectively order the datas by TypeID, meaning in this case that I want ALL the TypeID of value "1" to come first and then all the rest ("2" and higher) un-ordered. This is important that the rest remains unordered by their TypeID as I only want them to be ordered by their ID (ObjetID DESC). Is that possible? If yes how?Thank you.Francis
Hello all, Is there a way to do a selective restore? I need to create a dev db and the prod backup is 17 gig and I have a space crunch on the server. My idea was to restore the complete backup and subsequently shrink the db size after truncating data in tables which are not frequently used? Is that a good idea. Any help will be appreciated.
I need to be able to export from an existing database, all fields with a certain column id. I have been pointed in the direction of bcp, however I am having difficulty finding the right syntax.
Is it possible to use replication for inserts and updates only for some tables and inserts updates and deletes on others. I want to be able to delete data from the source database but not my replicated database. Does anyone know of a way to use replication to facilite this?
I'm in the current mode of migration from WIn2k and I 'm trying to setup user where they are only allowed access to one table.
If I grant thenm read /write access to the db they can obviously see all of the db due to the size of the db I do not wish to go down the root of denying every table as there is over 100. Is there an easier way??
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.
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.
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).
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.
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.
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.
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.
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.
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;
I was trying to use the case statement in where clause so that the comparison (> , <, =) can be made depending upon the value of the local variable @fl.
PLease tell me how to do that. Or suggest me how can I make selective comparison (<,>,=) in where clause depending upon a local variable. Please note that I donot want to use if/else satement and write select statement everytime based on the local variable as in that case the code length will be huge. Please suggest me a coensized query.
SQL that I queried:
use pubs go
declare @fl int
select fl = 3
select * from titles where case fl when 1 then price > 90 when 2 then price < 90 when 3 then price = 90 end
The following error is given
Server: Msg 170, Level 15, State 1, Line 7 Line 7: Incorrect syntax near '>'.