Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sybase uses bcp for single table backup and recovery

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The common data backup format is: bcp dbname..tablename out c:\ temp\ filename-Usa-Ppassword-Sservername-c

Where dbname is the database name, tablename is the table name,-U is the SYBASE login name,-P is the SYBASE login password,-S is the SYBASE service name (Servername), and-c represents the export of data in visible text.

If you only need to replace out with in for data recovery, but the bcp export does not contain the definition of the table, you need to use other tools such as DBArtisan or above to use the ddlgen command.

Use contract2011

Go

-- production bcp export script

Select 'bcp contract2011..' + name +' out D:\ temp\'+ name +'- Usa-P-SCMPROCE-c-tasking customers From sysobjects where type ='U'

Go

-- production bcp import script, 1000 line submission

Select 'bcp contract2011_new..' + name +' in D:\ temp\'+ name +'- Usa-P-SCMPROCE-c-tasking questions?-b 1000' from sysobjects where type ='U'

Go

-

Ddlgen usage:

1. Stored procedure

Ddlgen-Usa-P-SSYB_SERV-Duserdb-TP-N%-O proc.ddl

2. Database

Ddlgen-Usa-P-SSYB_SERV-Duserdb-TDB-Nuserdb-O db.ddl

3. Table structure

Ddlgen-Usa-P-SSYB_SERV-Duserdb-TU-N%-O table.ddl

4. View

Ddlgen-Usa-P-SSYB_SERV-Duserdb-TV-N%-O view.ddl

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report