| Author |
Topic |
|
kirank
Yak Posting Veteran
58 Posts |
Posted - 2012-08-24 : 06:20:04
|
| Hi, i just want one simple query where i can selct into production table(10.10.10.10).[table_name] from localdatabale [table_name]is it possible? or give me some other suggestion on it---------------------------http://codingstuffsbykiran.blogspot.com | http://webdevlopementhelp.blogspot.com |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2012-08-24 : 06:45:05
|
| Not sure what you want to do.Is this from a remote server? Use openquery or openrowset maybe==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2012-08-24 : 06:51:35
|
| A linked server would do that. |
 |
|
|
kirank
Yak Posting Veteran
58 Posts |
Posted - 2012-08-24 : 07:29:43
|
quote: Originally posted by nigelrivett
its very simple i just want to update my local table using remote (production) table.can you guys plz help me.---------------------------http://codingstuffsbykiran.blogspot.com | http://webdevlopementhelp.blogspot.com |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-08-24 : 07:34:34
|
| If you are doing this as a one-time thing, the simplest perhaps is to use the Import/Export Wizard. Right click on the local database name in SSMS Object Explorer, and select Tasks-> Import Data. Then, follow through the wizard. On one of the screens in the wizard, there is an "Edit Mappings" button. If you click on that button, it will give you option to append the data to your existing table, or completely remove the existing data and import the new data.If you need to do this on a regular basis (daily, for example), the wizard also gives you the option to save the task as a Package. You can then schedule to run the package daily, or even run it manually without having to go through the wizard. |
 |
|
|
kirank
Yak Posting Veteran
58 Posts |
Posted - 2012-08-24 : 08:09:54
|
quote: Originally posted by sunitabeck If you are doing this as a one-time thing, the simplest perhaps is to use the Import/Export Wizard. Right click on the local database name in SSMS Object Explorer, and select Tasks-> Import Data. Then, follow through the wizard. On one of the screens in the wizard, there is an "Edit Mappings" button. If you click on that button, it will give you option to append the data to your existing table, or completely remove the existing data and import the new data.If you need to do this on a regular basis (daily, for example), the wizard also gives you the option to save the task as a Package. You can then schedule to run the package daily, or even run it manually without having to go through the wizard.
hi sunita, thank you for reply. yes i am very much aware about this and i use this also.but now i m just looking for a query. i dont want to do like this way.can u plz provide me some query one it---------------------------http://codingstuffsbykiran.blogspot.com | http://webdevlopementhelp.blogspot.com |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-08-24 : 08:39:11
|
| If you do want to use a query, what Nigel or Ahmeds said would work. For example, if you want to use openrowset, take a look at this page, where they have documentation and couple of nice examples: http://msdn.microsoft.com/en-us/library/ms190312.aspxThis is pretty simple to use - you have to make sure that the domain (or SQL) user has access to the remote server and also ad hoc distributed queries are enabled.If you set up linked server, syntax-wise it is very similar to a local query, except you will be using four-part names: http://msdn.microsoft.com/en-us/library/ff772782.aspx |
 |
|
|
kirank
Yak Posting Veteran
58 Posts |
Posted - 2012-08-24 : 14:21:53
|
| hi sunita, thank's for reply, well i do the same , but can you suggest me shall i go with query or any tool, actually i have shared window hosting and using remote connection i am getting connecting to database , and i just want live data to local. thats it. (but in remote connection i m not able to get that Tasks-> Import Data option.---------------------------http://codingstuffsbykiran.blogspot.com | http://webdevlopementhelp.blogspot.com |
 |
|
|
|