Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
@echo off set TmpFile=D:\data_extract\counterval.txt sqlcmd -E -S servername\instance,port -d batch_stuff-Q"SET NOCOUNT ON; SELECT REPLACE(LTRIM(CounterValue),' ','') FROM batch_stuff..Counters WHERE CounterID = 1" -b -w 10 -h-1 -o "%TmpFile%" set InFile1=D:\data_extract\get_data.sql set InFile2=D:\data_extract\update_counter.sql set OutFile=D:\data_extract\data\BGM01_ set CurrDate=%date:~-4,4%%date:~-7,2%%date:~-10,2% set CurrTime=%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2% set OsqlParams1=-E -S servername\instance,port -d database -h-1 -n -w30 -i set OsqlParams2=-E -S servername\instance,port -d batch_stuff -h-1 -n -w30 -i if not exist "%TmpFile%" ( echo %TmpFile% not found. echo Press any key to quit ... pause > nul goto :EOF ) if not exist "%InFile%" ( echo %InFile% not found. echo Press any key to quit ... pause > nul goto :EOF ) for /f "tokens=*" %%A in ('type %TmpFile%') do set counter=%%A sqlcmd %OsqlParams1% "%InFile1%" -o "%OutFile%_D%CurrDate%_T%CurrTime%_0%counter%" sqlcmd %OsqlParams2% "%InFile2%"
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.