Trying to create a batch file that connects to a SQL Server from a schedule task on a server. I am new at the SQL game. Any one now a good example of batch file for this ? I run auotimport.bat to call raddbconnection and then import the paudit.dat into the SQL database rad_db into table PAUDIt. Here is what i have so far. Help ?
Autoimport.bat:
CALL raddbconnection.bat BULK INSERT PAUDIT FROM X:\RIS\SQLDB\PAUDIT.DAT WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) GO
raddbconnectionbat:
@Echo ON Data Source=UKH-SQLCL2VS2\CL2VS2;Initial Catalog=RAD_DB;User Id=;Password=;
Errors when runing:
H:\pgreer\My Documents>CALL raddbconnection.bat H:\pgreer\My Documents>Data Source=UKH-SQLCL2VS2\CL2VS2;Initial Catalog ser Id=;Password=; 'Data' is not recognized as an internal or external command, operable program or batch file. H:\pgreer\My Documents>BULK 'BULK' is not recognized as an internal or external command, operable program or batch file. H:\pgreer\My Documents>INSERT PAUDIT 'INSERT' is not recognized as an internal or external command, operable program or batch file. H:\pgreer\My Documents>FROM 'X:\RIS\SQLDB\PAUDIT.DAT' 'FROM' is not recognized as an internal or external command, operable program or batch file. H:\pgreer\My Documents>WITH 'WITH' is not recognized as an internal or external command, operable program or batch file. H:\pgreer\My Documents>( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) 'FIELDTERMINATOR' is not recognized as an internal or external command, operable program or batch file.
Your post will show up soon