Thursday, March 22, 2012
Copying structure of table form one database to another
using some type of table object, to copy a table form one database to
another. Just the structure , index, triggers, I don't want the data.kevin.jonas@.gmail.com wrote:
> I am wondering if there is a simple way, like a stored procudure or
> using some type of table object, to copy a table form one database to
> another. Just the structure , index, triggers, I don't want the data.
You can generate a script for the whole schema with EM and execute it on
the target db. Maybe there's also a solution involving DTS - I'm not sure.
robert|||Using DMO library also is possible and using DTS
--
Current location: Alicante (ES)
"Robert Klemme" wrote:
> kevin.jonas@.gmail.com wrote:
> You can generate a script for the whole schema with EM and execute it on
> the target db. Maybe there's also a solution involving DTS - I'm not sure
.
> robert
>
Monday, March 19, 2012
Copying large amount of data form MS Excel to MS Sql Server
I have got a senario in which large amount of data should be copied from MS excel to MS SQL server. which is the best option to do so. Because when I use recordsets the process is very slow and it effects the performance. Any one please suggest me.
Thanks
Anish
Quote:
Originally Posted by AnishAbs
Hi ,
I have got a senario in which large amount of data should be copied from MS excel to MS SQL server. which is the best option to do so. Because when I use recordsets the process is very slow and it effects the performance. Any one please suggest me.
Thanks
Anish
HI Anish,
I am working on sql2005.in this right click on thedatabase
-->go to all tasks .
---->select import data.
--->select msexcel
---->enter the exel file path
---->select all data in exel
---->click on finish.
i think it is also works in sql2000. in 2000 you have to do it enterprise manager|||hi,
if the no of records are greater than 67000 in excel,it is not possible to copy to sql server.you need to split that excel into different files.
if you can copy that excel to MSaccess you can send large data to sql server
through dts only.|||Hi,
Use the Import/Export wizard to import the excel file into you destination database.
Cheers.
Wednesday, March 7, 2012
copying a table from one database to another
Hey
in query analyzer, how do you copy a table form one db to another db
i thort it was something like
select * into dbo.databaseA.tableNew from dbo.databaseB.tableOld
cheers
insert into databaseA..tableNewselect *From databaseb..tableOld|||
The difference between SELECT INTO and INSERT INTO is that with INSERT the table must already exist. SELECT INTO creates a new table.
Your original query looked okay, assuming that you wanted a new table tableNew. What error were you getting? You might also have a permissions problem since you are going from one database to another.
Don
hey
yeah... thats why i 'd like to use select into or otherwise i'll have to create the other table ( not as fast )
when i try to run
select * into dbo.databaseA.tableNew from dbo.databaseB.tableOld
i get
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name dbo.databaseB.tableOld
i've tripple checked the spelling and tried the same thing with other databases on other computers and got the same error so i'm sure its not a permission error or anything, must be syntax
cheers
|||Use this:select * into databaseA..tableNew from databaseB..tableOld|||
Matt-dot-net:
Use this:select * into databaseA..tableNew from databaseB..tableOld
<groan> I HATE when I miss things like that!
Don
|||cheers bruva, just what i needed
Copying a table form one database to another
(2K) database and to another SQL Server database on the same PC.
With MS Access, I was able to use a SELECT INTO statement to move data
between databases by the use of the IN clause to a newly created table in an
external database, such as . .
SELECT * INTO tablename1 IN 'msaccess database path and name' 'DBTYPE FROM
tablename2
(tablename1 would be a newly created table in the external database,
tablename2 would be the connected database table.)
Can the similar method be employed with SQL Server? (I'm using vb.net 1.1
as my development tool.)
Any help would be greatly appriciated
Thanks
Dave M.Yes, it's possible, but it depends on several things. First, is there should
be a linked server defined on serverb to link to serverA? Must have
permissions to at least read servera data, and write serverb data.
Also, is serverB set to allow a "select into"? It is possible to block this
command.
If everything is set up, you can execute a query like this on the
destination serverb:
Select *
into destbdatabase.dbo.dest_table
from servera.databasename.dbo.source_table
"dave m" wrote:
> To be brief, I need to copy a table (schema and data) from one SQL Server
> (2K) database and to another SQL Server database on the same PC.
> With MS Access, I was able to use a SELECT INTO statement to move data
> between databases by the use of the IN clause to a newly created table in
an
> external database, such as . .
> SELECT * INTO tablename1 IN 'msaccess database path and name' 'DBTYPE FROM
> tablename2
> (tablename1 would be a newly created table in the external database,
> tablename2 would be the connected database table.)
> Can the similar method be employed with SQL Server? (I'm using vb.net 1.
1
> as my development tool.)
> Any help would be greatly appriciated
> Thanks
> Dave M.
>
>|||Depends on what you mean by "schema". If all you want are the fields
and the data contained in them, do the following:
SELECT * INTO db2..table FROM db1..table
If you want the entire table schema, meaning triggers, constraints,
etc, the easiest thing would be to use the DTS import/export tools.
Right-click on the table and choose "Export".|||Try www.sqlscripter.com to script your data.
"dave m" wrote:
> To be brief, I need to copy a table (schema and data) from one SQL Server
> (2K) database and to another SQL Server database on the same PC.
> With MS Access, I was able to use a SELECT INTO statement to move data
> between databases by the use of the IN clause to a newly created table in
an
> external database, such as . .
> SELECT * INTO tablename1 IN 'msaccess database path and name' 'DBTYPE FROM
> tablename2
> (tablename1 would be a newly created table in the external database,
> tablename2 would be the connected database table.)
> Can the similar method be employed with SQL Server? (I'm using vb.net 1.
1
> as my development tool.)
> Any help would be greatly appriciated
> Thanks
> Dave M.
>
>