Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 script for export

Author  Topic 

asadkhan_3
Starting Member

3 Posts

Posted - 2010-03-07 : 04:39:51
@echo off
CLS
REM ********************************
SET V_USER=riyadh
SET V_PASSWORD=riyadh
SET V_DB=vis
SET V_DMP_PATH=D:\dumpREM ********************************
ECHO.

SET EXP_PATH=D:\oracle\visdb\9.2.0\binSET MONTH=%DATE:~4,2%
SET YEAR=%DATE:~10,4%
SET DATED=%DATE:~-7,2%
ECHO ECHO CONNECT AS : %V_USER%/%V_PASSWORD%@%V_DB%
ECHO Backup on : %DATED%/%MONTH%/%YEAR% (DD/MM/YYYY)
ECHO SAVE AS : %V_DMP_PATH%%V_USER%_%DATED%%MONTH%%YEAR%.dmp
ECHO TITLE BACKUP ...%V_USER%_%DATED%%MONTH%%YEAR%
echo.
%EXP_PATH%EXP.exe %V_USER%/%V_PASSWORD%@%V_DB% file=%V_DMP_PATH%%V_USER%_%DATED%%MONTH%%YEAR%.dmp log=%V_DMP_PATH%%V_USER%_%DATED%%MONTH%%YEAR%.log

i am executing the above script successfully in oracle but i have one sql server database also can anyone tell me wat changes should i need to run this script on sql server 2005

thanks a lot

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2010-03-08 : 04:09:17
the syntax for backup is different in sql server.
refer this ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/89a4658a-62f1-4289-8982-f072229720a1.htm
in books online for syntax.
Go to Top of Page

asadkhan_3
Starting Member

3 Posts

Posted - 2010-03-08 : 07:34:53
i did not understand wat u mean and how can anyone change the script accordinly to run on sql server by scheduled task as i am performing on oracle

Thanks a lot
Go to Top of Page

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2010-03-09 : 06:16:46
quote:
Originally posted by asadkhan_3
i am executing the above script successfully in oracle but i have one sql server database also can anyone tell me wat changes should i need to run this script on sql server 2005



do u want to make changes in the sql database to match the script


Go to Top of Page

asadkhan_3
Starting Member

3 Posts

Posted - 2010-03-10 : 03:37:33
i want to do the changes in my script to run it successfully on sql server if anyone can reply in this regard
Go to Top of Page

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2010-03-10 : 05:48:24
quote:
Originally posted by asadkhan_3

i want to do the changes in my script to run it successfully on sql server if anyone can reply in this regard


if thats the case, then refer to my earlier post and learn to do backup in sql server. you can then easily modify your existing code.
Go to Top of Page
   

- Advertisement -