Showing posts with label identical. Show all posts
Showing posts with label identical. Show all posts

Tuesday, March 27, 2012

Copy job from one server to another

How do you copy a job from one server to another. Identical databases different servers with different names
Hi,
There are 3 options:-
1.
You can generate the script for all jobs ( Enterprise manager -- Right click
on the jobs
node in SQl Agent -- Jobs| All tasks| Generate sql script, Save it as file).
Run this
script in the destination server.
2.
"Transfer Jobs" Task in DTS, That will transfer the jobs to new server.
3.
Jobs, operators , Alerts ,...are stored in msdb database.If the destination
server
is a new one and if you do not have any existing stuffs in msdb , you can
even restore a msdb backup from the source server.
-
Thanks
Hari
MCDBA
"cbriscoejr" <cbriscoejr@.discussions.microsoft.com> wrote in message
news:B1336E38-C8C8-4F1B-BB8D-87E92ADD338F@.microsoft.com...
> How do you copy a job from one server to another. Identical databases
different servers with different names

Thursday, March 8, 2012

Copy Data....

Greetings,
Here's my problem. I have 2 databases, both on different instance installs,
with two identical tables. I want to copy the "Region" column data from one
table to the "Region" column of the other table. I thought this would be a
simple copy and paste situation, but apparently not. Any ideas?
Thanks
Ken S.You could either us DTS (export/Import) with a query that
select's only the column your interested in.
Or you could BCP with a select statment like so...
bcp "select column_name FROM db.dbo.table(nolock)"
queryout \\server\d$\ouput.txt -N -T -SServername -
eerror.err -b10000
>--Original Message--
>Greetings,
>Here's my problem. I have 2 databases, both on different
instance installs,
>with two identical tables. I want to copy the "Region"
column data from one
>table to the "Region" column of the other table. I
thought this would be a
>simple copy and paste situation, but apparently not. Any
ideas?
>Thanks
>Ken S.
>
>.
>|||OK great...let me try the DTS option first...
<anonymous@.discussions.microsoft.com> wrote in message
news:020401c3c4fe$62585800$a001280a@.phx.gbl...
> You could either us DTS (export/Import) with a query that
> select's only the column your interested in.
> Or you could BCP with a select statment like so...
> bcp "select column_name FROM db.dbo.table(nolock)"
> queryout \\server\d$\ouput.txt -N -T -SServername -
> eerror.err -b10000
> >--Original Message--
> >Greetings,
> >
> >Here's my problem. I have 2 databases, both on different
> instance installs,
> >with two identical tables. I want to copy the "Region"
> column data from one
> >table to the "Region" column of the other table. I
> thought this would be a
> >simple copy and paste situation, but apparently not. Any
> ideas?
> >
> >Thanks
> >
> >Ken S.
> >
> >
> >.
> >

Copy data in Sql Server table A to B on same server - Identical schemas

Greetings,

I have two SQL Server tables on the same server and in the same database. I'll call them table A and table B. They have identical schemas. I need to insert all rows in table A into table B. (Don't laugh - this is just for testing and long run the tables will reside on different servers.)

Can someone please tell me the correct task to use for this and the connection type I need for both the source and destination?

Thanks,

Black Cat Bone

If they are in the same database then a SQL statement should do it. You don't need SSIS.

INSERT INTO TableB SELECT <column-list> FROM TableB

-Jamie

|||

Hello,

I did not explain well. Inserting rows from table A into table B is just one small piece of the overall SSIS package. I've got the two tables on the same server now just to get the package running in a "semi-realistic" setting - long run, tables A and B will be on different servers. I don't have permission to access the other database/server yet so I'm approximating the eventual package by having the two tables in the same server. This will allow me to get the other tasks operating properly.

Can you provide guidance on the best way to insert rows from A into B within SSIS?

Thanks,

BCB

|||Create an OLE DB Source and perform your data select within that. Then simply attach it to an OLE DB Destination, where you select your destination table. Easy and it will allow you to change your destination later when you move TABLE B to another server, or whatever.|||I would add to Phil's comment: Create separate connection managers for Source and destination components. If both tables are in the same server, having a single connection manager is fine; but once you move table B to a new server, an additional connection manager will be needed; so do it from the begining so you don't have to modify the package later.|||

Rafael Salas wrote:

I would add to Phil's comment: Create separate connection managers for Source and destination components. If both tables are in the same server, having a single connection manager is fine; but once you move table B to a new server, an additional connection manager will be needed; so do it from the begining so you don't have to modify the package later.

Yep, that's what I had in my head, but didn't state it. Thanks, Rafael!|||

Thank you - it worked when I used the OLE DB source and destination. I am just wondering if this could have worked with the SQL Server Destination, which is what I was trying to use. I'm also wondering to myself why there is no SQL Server Source.

Regards,

BCB

|||You could use the SQL Server destination provided that the package is being executed on the SQL Server itself, as my understanding is that the SQL Server destination is really an in-memory hook to SQL Server.|||

Phil's right. That's exactly what it is. Its explained a bit more here:

Destination Adapter Comparison
(http://blogs.conchango.com/jamiethomson/archive/2006/08/14/4344.aspx)

-Jamie

Saturday, February 25, 2012

Copy a record from one table to another?

Hello,

Is there a way of copying/moving a record from one table to another identical table on the same database using ADO.NET
I can obviously do it the long way (retrieving a record, then pushing it up using a second SQL command)
I was just wondering if there is a way to do it in one database hit using some kind of cool SQL function.Look at the insert ... select statement in Books on Line

insert into table1
(field1, field2)
select
field1, field2
from table2
where recordid = 1|||If there are no identity fields involved, you can exclude the field names:

INSERT INTO table1
SELECT * FROM table2
WHERE id = 3