Showing posts with label db1. Show all posts
Showing posts with label db1. Show all posts

Tuesday, March 20, 2012

Copying specific data from table in DB1 to table in DB2

I need to copy the following columns from my Employee table in my Performance DB to my Employee table in my VacationRequest DB:
CompanyID, FacilityID, EmployeeID, FirstName, LastName,
[Password] = 'nippert', Role = 'Employee'

I tried the advice on this website but to no avail:
http://www.w3schools.com/sql/sql_select_into.aspHi Jason,INSERT INTO should fit your needs.

Thursday, March 8, 2012

copying data across databases

I have a basic question:
We have a database db1 on SQLServer 2005 that gets updated v frequently.
We would to like use a different database db2 (on a different SQL Server
instance) that is a snapshot of db1. db2 is a read-only database that would
be used for reporting purposes. On a daily basis, the new data from db1 must
get copied to db2.
Is there a SQLServer Tool that would help? I tried using Copy data from SQL
Server management Studio; it copied most of the data (not all), but did not
create the indexes that existed for the tables in db1.
Option 1: DTS Package (SSIS in 2005) to update the tables
Option 2: Replication
Thanks & Rate the Postings.
-Ravi-
"Jason Manfield" wrote:

> I have a basic question:
> We have a database db1 on SQLServer 2005 that gets updated v frequently.
> We would to like use a different database db2 (on a different SQL Server
> instance) that is a snapshot of db1. db2 is a read-only database that would
> be used for reporting purposes. On a daily basis, the new data from db1 must
> get copied to db2.
> Is there a SQLServer Tool that would help? I tried using Copy data from SQL
> Server management Studio; it copied most of the data (not all), but did not
> create the indexes that existed for the tables in db1.
|||option 3 = LogShipping
Greg Jackson
PDX, Oregon
|||There is a slight change is our requirements:
Data does NOT have to copied on an incremental basis. A full copy needs to
be done from the database db1 that is periodically updated to the database
db2 that is a read-only database. In that case, what are the options
available on SqlServer 2005?
"pdxJaxon" wrote:

> option 3 = LogShipping
>
> Greg Jackson
> PDX, Oregon
>
>

copying data across databases

I have a basic question:
We have a database db1 on SQLServer 2005 that gets updated v frequently.
We would to like use a different database db2 (on a different SQL Server
instance) that is a snapshot of db1. db2 is a read-only database that would
be used for reporting purposes. On a daily basis, the new data from db1 must
get copied to db2.
Is there a SQLServer Tool that would help? I tried using Copy data from SQL
Server management Studio; it copied most of the data (not all), but did not
create the indexes that existed for the tables in db1.Option 1: DTS Package (SSIS in 2005) to update the tables
Option 2: Replication
--
Thanks & Rate the Postings.
-Ravi-
"Jason Manfield" wrote:
> I have a basic question:
> We have a database db1 on SQLServer 2005 that gets updated v frequently.
> We would to like use a different database db2 (on a different SQL Server
> instance) that is a snapshot of db1. db2 is a read-only database that would
> be used for reporting purposes. On a daily basis, the new data from db1 must
> get copied to db2.
> Is there a SQLServer Tool that would help? I tried using Copy data from SQL
> Server management Studio; it copied most of the data (not all), but did not
> create the indexes that existed for the tables in db1.|||option 3 = LogShipping
Greg Jackson
PDX, Oregon|||There is a slight change is our requirements:
Data does NOT have to copied on an incremental basis. A full copy needs to
be done from the database db1 that is periodically updated to the database
db2 that is a read-only database. In that case, what are the options
available on SqlServer 2005?
"pdxJaxon" wrote:
> option 3 = LogShipping
>
> Greg Jackson
> PDX, Oregon
>
>

copying data across databases

I have a basic question:
We have a database db1 on SQLServer 2005 that gets updated v frequently.
We would to like use a different database DB2 (on a different SQL Server
instance) that is a snapshot of db1. DB2 is a read-only database that would
be used for reporting purposes. On a daily basis, the new data from db1 must
get copied to db2.
Is there a SQLServer Tool that would help? I tried using Copy data from SQL
Server management Studio; it copied most of the data (not all), but did not
create the indexes that existed for the tables in db1.Option 1: DTS Package (SSIS in 2005) to update the tables
Option 2: Replication
Thanks & Rate the Postings.
-Ravi-
"Jason Manfield" wrote:

> I have a basic question:
> We have a database db1 on SQLServer 2005 that gets updated v frequently.
> We would to like use a different database DB2 (on a different SQL Server
> instance) that is a snapshot of db1. DB2 is a read-only database that woul
d
> be used for reporting purposes. On a daily basis, the new data from db1 mu
st
> get copied to db2.
> Is there a SQLServer Tool that would help? I tried using Copy data from SQ
L
> Server management Studio; it copied most of the data (not all), but did no
t
> create the indexes that existed for the tables in db1.|||option 3 = LogShipping
Greg Jackson
PDX, Oregon|||There is a slight change is our requirements:
Data does NOT have to copied on an incremental basis. A full copy needs to
be done from the database db1 that is periodically updated to the database
db2 that is a read-only database. In that case, what are the options
available on SqlServer 2005?
"pdxJaxon" wrote:

> option 3 = LogShipping
>
> Greg Jackson
> PDX, Oregon
>
>

Friday, February 24, 2012

Copy/move data from TableA in DB1 to TableB in DB2 within the same SQL Server

Hallo,
I thouhgt it would be easily done, but no. I have a copy of data i saved in
another DB while laying out the original Database i want to use in producto
n Envi. The Prodution DB is finally ready and i want to move the 3 columns
of data in the first Databs
e into a table in the new database. I have tried "select into", "copy" with
out success.
The old DBTable has 3 Columns of hundreds of rows that i must move to 3 simi
lar columns in a table (15 columns) in the new database. The old table does
not have an ID, but the new table does.
Can someone help. I want to show this to my boss tomorrow.
Thanks.How would you relate the rows in the two tables to each other?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Omooba" <anonymous@.discussions.microsoft.com> wrote in message
news:B2D46104-7C63-4907-AB44-F8EC6FF860A4@.microsoft.com...
> Hallo,
> I thouhgt it would be easily done, but no. I have a copy of data i saved
in another DB while laying out the original Database i want to use in
producton Envi. The Prodution DB is finally ready and i want to move the 3
columns of data in the first Databse into a table in the new database. I
have tried "select into", "copy" without success.
> The old DBTable has 3 Columns of hundreds of rows that i must move to 3
similar columns in a table (15 columns) in the new database. The old table
does not have an ID, but the new table does.
> Can someone help. I want to show this to my boss tomorrow.
> Thanks.

Sunday, February 19, 2012

Copy table values between different database

Hi guys,
I've a problem...
I've a SQL Server database (DB1) with a table (T1) and I want to copy all
the values in T1 to the same table (T2) located on the SQL Server database
DB2.
I want to perform this task by using a stored procedure launched by the
server DB1.
How can I perform this task?
If I have the 2 table on the same db I'll do something like this:
SELECT ....
INTO T2
FROM T1 WHERE ....
but how can I write this by saying that the 2 tables are on differen
databases?
Thanks in advance for all that can help me!
Steve,
Use the database name as part of the object identifier. See "Using
Identifiers as Object Names" in BOL.
Example:
use northwind
go
select * into pubs..t from orders
select * from pubs..t
drop table pubs..t
go
AMB
"Steve" wrote:

> Hi guys,
> I've a problem...
> I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> the values in T1 to the same table (T2) located on the SQL Server database
> DB2.
> I want to perform this task by using a stored procedure launched by the
> server DB1.
> How can I perform this task?
> If I have the 2 table on the same db I'll do something like this:
> SELECT ....
> INTO T2
> FROM T1 WHERE ....
> but how can I write this by saying that the 2 tables are on differen
> databases?
> Thanks in advance for all that can help me!
|||Qualify the source or destination table (whichever is applicable) such as
dbname.owner.tablename
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Steve" <Steve@.discussions.microsoft.com> wrote in message
news:FC0C0FA8-E57D-42A9-9706-BBEDBB145DB5@.microsoft.com...
> Hi guys,
> I've a problem...
> I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> the values in T1 to the same table (T2) located on the SQL Server database
> DB2.
> I want to perform this task by using a stored procedure launched by the
> server DB1.
> How can I perform this task?
> If I have the 2 table on the same db I'll do something like this:
> SELECT ....
> INTO T2
> FROM T1 WHERE ....
> but how can I write this by saying that the 2 tables are on differen
> databases?
> Thanks in advance for all that can help me!
|||select ...
INTO DB2.owner.TableName
FROM DB1.owner.TableName
Your stored procedure needs appropriate permission on DB1 and DB2. Look for
ownership chains in BOL.
Ana
"Steve" wrote:

> Hi guys,
> I've a problem...
> I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> the values in T1 to the same table (T2) located on the SQL Server database
> DB2.
> I want to perform this task by using a stored procedure launched by the
> server DB1.
> How can I perform this task?
> If I have the 2 table on the same db I'll do something like this:
> SELECT ....
> INTO T2
> FROM T1 WHERE ....
> but how can I write this by saying that the 2 tables are on differen
> databases?
> Thanks in advance for all that can help me!
|||Thanks a lot guys... more easy than what I think
"Tibor Karaszi" wrote:

> Qualify the source or destination table (whichever is applicable) such as
> dbname.owner.tablename
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Steve" <Steve@.discussions.microsoft.com> wrote in message
> news:FC0C0FA8-E57D-42A9-9706-BBEDBB145DB5@.microsoft.com...
>
>

Copy table values between different database

Hi guys,
I've a problem...
I've a SQL Server database (DB1) with a table (T1) and I want to copy all
the values in T1 to the same table (T2) located on the SQL Server database
DB2.
I want to perform this task by using a stored procedure launched by the
server DB1.
How can I perform this task?
If I have the 2 table on the same db I'll do something like this:
SELECT ....
INTO T2
FROM T1 WHERE ....
but how can I write this by saying that the 2 tables are on differen
databases?
Thanks in advance for all that can help me!Steve,
Use the database name as part of the object identifier. See "Using
Identifiers as Object Names" in BOL.
Example:
use northwind
go
select * into pubs..t from orders
select * from pubs..t
drop table pubs..t
go
AMB
"Steve" wrote:
> Hi guys,
> I've a problem...
> I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> the values in T1 to the same table (T2) located on the SQL Server database
> DB2.
> I want to perform this task by using a stored procedure launched by the
> server DB1.
> How can I perform this task?
> If I have the 2 table on the same db I'll do something like this:
> SELECT ....
> INTO T2
> FROM T1 WHERE ....
> but how can I write this by saying that the 2 tables are on differen
> databases?
> Thanks in advance for all that can help me!|||Qualify the source or destination table (whichever is applicable) such as
dbname.owner.tablename
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Steve" <Steve@.discussions.microsoft.com> wrote in message
news:FC0C0FA8-E57D-42A9-9706-BBEDBB145DB5@.microsoft.com...
> Hi guys,
> I've a problem...
> I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> the values in T1 to the same table (T2) located on the SQL Server database
> DB2.
> I want to perform this task by using a stored procedure launched by the
> server DB1.
> How can I perform this task?
> If I have the 2 table on the same db I'll do something like this:
> SELECT ....
> INTO T2
> FROM T1 WHERE ....
> but how can I write this by saying that the 2 tables are on differen
> databases?
> Thanks in advance for all that can help me!|||select ...
INTO DB2.owner.TableName
FROM DB1.owner.TableName
Your stored procedure needs appropriate permission on DB1 and DB2. Look for
ownership chains in BOL.
Ana
"Steve" wrote:
> Hi guys,
> I've a problem...
> I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> the values in T1 to the same table (T2) located on the SQL Server database
> DB2.
> I want to perform this task by using a stored procedure launched by the
> server DB1.
> How can I perform this task?
> If I have the 2 table on the same db I'll do something like this:
> SELECT ....
> INTO T2
> FROM T1 WHERE ....
> but how can I write this by saying that the 2 tables are on differen
> databases?
> Thanks in advance for all that can help me!|||Thanks a lot guys... more easy than what I think :)
"Tibor Karaszi" wrote:
> Qualify the source or destination table (whichever is applicable) such as
> dbname.owner.tablename
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Steve" <Steve@.discussions.microsoft.com> wrote in message
> news:FC0C0FA8-E57D-42A9-9706-BBEDBB145DB5@.microsoft.com...
> > Hi guys,
> > I've a problem...
> > I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> > the values in T1 to the same table (T2) located on the SQL Server database
> > DB2.
> > I want to perform this task by using a stored procedure launched by the
> > server DB1.
> > How can I perform this task?
> > If I have the 2 table on the same db I'll do something like this:
> > SELECT ....
> > INTO T2
> > FROM T1 WHERE ....
> > but how can I write this by saying that the 2 tables are on differen
> > databases?
> > Thanks in advance for all that can help me!
>
>

Copy table values between different database

Hi guys,
I've a problem...
I've a SQL Server database (DB1) with a table (T1) and I want to copy all
the values in T1 to the same table (T2) located on the SQL Server database
DB2.
I want to perform this task by using a stored procedure launched by the
server DB1.
How can I perform this task?
If I have the 2 table on the same db I'll do something like this:
SELECT ....
INTO T2
FROM T1 WHERE ....
but how can I write this by saying that the 2 tables are on differen
databases?
Thanks in advance for all that can help me!Steve,
Use the database name as part of the object identifier. See "Using
Identifiers as Object Names" in BOL.
Example:
use northwind
go
select * into pubs..t from orders
select * from pubs..t
drop table pubs..t
go
AMB
"Steve" wrote:

> Hi guys,
> I've a problem...
> I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> the values in T1 to the same table (T2) located on the SQL Server database
> DB2.
> I want to perform this task by using a stored procedure launched by the
> server DB1.
> How can I perform this task?
> If I have the 2 table on the same db I'll do something like this:
> SELECT ....
> INTO T2
> FROM T1 WHERE ....
> but how can I write this by saying that the 2 tables are on differen
> databases?
> Thanks in advance for all that can help me!|||Qualify the source or destination table (whichever is applicable) such as
dbname.owner.tablename
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Steve" <Steve@.discussions.microsoft.com> wrote in message
news:FC0C0FA8-E57D-42A9-9706-BBEDBB145DB5@.microsoft.com...
> Hi guys,
> I've a problem...
> I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> the values in T1 to the same table (T2) located on the SQL Server database
> DB2.
> I want to perform this task by using a stored procedure launched by the
> server DB1.
> How can I perform this task?
> If I have the 2 table on the same db I'll do something like this:
> SELECT ....
> INTO T2
> FROM T1 WHERE ....
> but how can I write this by saying that the 2 tables are on differen
> databases?
> Thanks in advance for all that can help me!|||select ...
INTO DB2.owner.TableName
FROM DB1.owner.TableName
Your stored procedure needs appropriate permission on DB1 and DB2. Look for
ownership chains in BOL.
Ana
"Steve" wrote:

> Hi guys,
> I've a problem...
> I've a SQL Server database (DB1) with a table (T1) and I want to copy all
> the values in T1 to the same table (T2) located on the SQL Server database
> DB2.
> I want to perform this task by using a stored procedure launched by the
> server DB1.
> How can I perform this task?
> If I have the 2 table on the same db I'll do something like this:
> SELECT ....
> INTO T2
> FROM T1 WHERE ....
> but how can I write this by saying that the 2 tables are on differen
> databases?
> Thanks in advance for all that can help me!|||Thanks a lot guys... more easy than what I think
"Tibor Karaszi" wrote:

> Qualify the source or destination table (whichever is applicable) such as
> dbname.owner.tablename
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "Steve" <Steve@.discussions.microsoft.com> wrote in message
> news:FC0C0FA8-E57D-42A9-9706-BBEDBB145DB5@.microsoft.com...
>
>