Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
37 views

Export Import Between SQL Tables

This document describes how to export data from tables in one TAC log database and import it into corresponding tables in a new TAC log database. The process involves exporting data from the TrendLog and TrendLogValue tables using bcp commands, importing the exported data files into the corresponding tables in the new database using bcp, and then confirming the data was successfully migrated by running TAC Vista.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Export Import Between SQL Tables

This document describes how to export data from tables in one TAC log database and import it into corresponding tables in a new TAC log database. The process involves exporting data from the TrendLog and TrendLogValue tables using bcp commands, importing the exported data files into the corresponding tables in the new database using bcp, and then confirming the data was successfully migrated by running TAC Vista.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Importing/Exporting data between tac log databases

This document describes how to export data from a table in a taclogdata


database and import it to the corresponding table in a new taclogdata database
created via TAC Vista Server Setup. This document covers exporting followed by
exporting of data from the TrendLog and TrendlogValue tables. Only the data is
exported/imported not the formatting, which can be useful if the database is
corrupted.

1. Create the new database.

i. Run TAC Vista Server setup and select the SQL Server tab.

i. Under SQL configuration select custom.


i. The following dialogue will appear:
i. Click on OK.
i. Change the name of the SQL database under “Log database name:” (ie.
Taclogdata1 as shown in the image below.
i. Click on Apply.

g. The following message should appear:


h. Click on OK.
i. When the creation process is finished, click on Test Connection. If
everything has been done correctly the message “Connection test
succeeded” should appear.
2. Install/run SQL Server management studio

If not already installed the application can be downloaded from the following link:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c243a5ae-4bd1-
4e3d-94b8-5a0f62bf7796

a. Once opened, make a note of the SQL server name (see below).

b. Expand the “Databases” folder and confirm that the source (the current
TAC Vista Log database) and the newly created (taclogdata1 in our example)
exist.

In the following steps <source database> refers to the current TAC Vista log
database – taclogdata by default - and <SQL server name> refers to the name
identified in step 2.a.

3. Export of data from TrendLog table.

a. Open the command prompt and type in the following text:

bcp "SELECT * from <source database>.dbo.TrendLog" queryout


c:\trendlog.bcp -n -T -S <SQL server name>

b. Observe that the copying is carried out without any errors.

4. Export of data from TrendLogValue table.

a. In the command prompt and type in the following text:

bcp "SELECT * from <source database>.TrendLogValue" queryout


c:\trendlogvalue.bcp -n -T -S <SQL server name>

b. Observe that the copying is carried out without any errors.

5. Import of TrendLog table

a. In the command prompt and type in the following text:


bcp <destination database>.dbo.trendLog in "C:\trendlog.bcp" -n -S <SQL
server name> –T

b. Observe that the copying is carried out without any errors.

6. Import of TrendLogValue table

a. In the command prompt and type in the following text:

bcp <destination database>.dbo.trendLogValue in "C:\trendlogValue.bcp" -n -


S <SQL server name> -T

b. Observe that the copying is carried out without any errors.

7. Run TAC Vista.

Run TAC Vista and confirm that all trend logs etc in the Vista database are
retrievable.

You might also like