I have two database and both of them has the same table, i want to copy all info from this first table to the secornd table
For Example:
Database : DB_1, table is table_1
Database : DB_2, table is table_2
both table_1 and table_2 have the same struct
how can i insert all records from table_1 to table_2
thanksYou can use DTS by using wizard from enterprise manager, if its one-off option.
Otherwise schedule that package as a job oto execute in periodic basis.|||if it is just one table and one time affair, then u can just import the data from EM using the import wizard.|||can you show me in programming|||Use a SELECT subquery to specify the data values for one or more rows.
INSERT INTO MyTable (PriKey, Description)
SELECT ForeignKey, Description
FROM SomeView
And review information from SQL books online.
Showing posts with label copy. Show all posts
Showing posts with label copy. Show all posts
Wednesday, March 28, 2012
Sunday, February 19, 2012
how to hook into sql server with vbscript or C# ?
How can I do this with vbscript, or C# ?
- Copy backup files down from a network share, into the data directory of my
local sql 2005 instance
- perform a restore using the files copied from above
- Execute a dts package
More info:
Our databases are scripted and exist on the typical development, and testing
enviroments. So as I get ready to start a new application, I want my local
sql instance to be updated based on structure changes as well as data. So I
have to apply the changes from the scripted sources and pull over the data.
I would naturally like to automate this.
ideas / suggestions welcomeHello bitshift,
Three thoughts:
a. Use Visual Studio Team Edition for the Database Developer (aka Data Dude)
since it has this "in the box"
b. Look at tools like Red-Gate's SqlCompare.
c. If you insist on rolling your own (which is doable, but a lot of work),
investigate the Server Management Objects namespace in BOL (see "Getting
Started in SMO").
Thanks!
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||"Kent Tegels" <ktegels@.develop.com> wrote in message
news:18f2bcb127c088c9d58e6fc9fc70@.news.microsoft.com...
> a. Use Visual Studio Team Edition for the Database Developer (aka Data
> Dude) since it has this "in the box"
this isn't in my MSDN subscription except as a trial; do you know if
there's any way to get hold of it for less than the $3700 or so Programmer's
Paradise wants ?
is it an add-on that I could put on top of VS2005 or a completely separate
product? how does it compare to the Redgate tools ? where there's a
comparision of course ..|||Are you trying to do a custom log shipping? If you are, check out my blog
entry (this of course doesnt include the DTS portion) ;-)
http://bassplayerdoc.blogspot.com/2007/10/your-poor-mans-sql-server-log-shipping.html
"bitshift" <jobob@.aol.com> wrote in message
news:Obd7Kj5BIHA.5980@.TK2MSFTNGP04.phx.gbl...
> How can I do this with vbscript, or C# ?
> - Copy backup files down from a network share, into the data directory of
> my local sql 2005 instance
> - perform a restore using the files copied from above
> - Execute a dts package
>
> More info:
> Our databases are scripted and exist on the typical development, and
> testing enviroments. So as I get ready to start a new application, I want
> my local sql instance to be updated based on structure changes as well as
> data. So I have to apply the changes from the scripted sources and pull
> over the data. I would naturally like to automate this.
> ideas / suggestions welcome
>
- Copy backup files down from a network share, into the data directory of my
local sql 2005 instance
- perform a restore using the files copied from above
- Execute a dts package
More info:
Our databases are scripted and exist on the typical development, and testing
enviroments. So as I get ready to start a new application, I want my local
sql instance to be updated based on structure changes as well as data. So I
have to apply the changes from the scripted sources and pull over the data.
I would naturally like to automate this.
ideas / suggestions welcomeHello bitshift,
Three thoughts:
a. Use Visual Studio Team Edition for the Database Developer (aka Data Dude)
since it has this "in the box"
b. Look at tools like Red-Gate's SqlCompare.
c. If you insist on rolling your own (which is doable, but a lot of work),
investigate the Server Management Objects namespace in BOL (see "Getting
Started in SMO").
Thanks!
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||"Kent Tegels" <ktegels@.develop.com> wrote in message
news:18f2bcb127c088c9d58e6fc9fc70@.news.microsoft.com...
> a. Use Visual Studio Team Edition for the Database Developer (aka Data
> Dude) since it has this "in the box"
this isn't in my MSDN subscription except as a trial; do you know if
there's any way to get hold of it for less than the $3700 or so Programmer's
Paradise wants ?
is it an add-on that I could put on top of VS2005 or a completely separate
product? how does it compare to the Redgate tools ? where there's a
comparision of course ..|||Are you trying to do a custom log shipping? If you are, check out my blog
entry (this of course doesnt include the DTS portion) ;-)
http://bassplayerdoc.blogspot.com/2007/10/your-poor-mans-sql-server-log-shipping.html
"bitshift" <jobob@.aol.com> wrote in message
news:Obd7Kj5BIHA.5980@.TK2MSFTNGP04.phx.gbl...
> How can I do this with vbscript, or C# ?
> - Copy backup files down from a network share, into the data directory of
> my local sql 2005 instance
> - perform a restore using the files copied from above
> - Execute a dts package
>
> More info:
> Our databases are scripted and exist on the typical development, and
> testing enviroments. So as I get ready to start a new application, I want
> my local sql instance to be updated based on structure changes as well as
> data. So I have to apply the changes from the scripted sources and pull
> over the data. I would naturally like to automate this.
> ideas / suggestions welcome
>
Subscribe to:
Posts (Atom)