473,408 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Testing load scripts

I have build a long sql data load script. What is the best way to do
Testing of the script? I would like to automate the test!

Oct 22 '06 #1
1 2499
For automation, I would check out the command line utilities: isql,
osql or sqlcmd depending on which version of sql server you are using.

We often run our tests from command scripts. e.g. Copy the following
into a cmd file (MyTest.cmd). You can then execute as follows:
MyTest.cmd myserver mydatabase

--------------------------------------------------

@echo off
REM: Usage: CommandFilename [Server] [Database]

if '%1' == '' goto usage
if '%2' == '' goto usage

if '%1' == '/?' goto usage
if '%1' == '-?' goto usage
if '%1' == '?' goto usage
if '%1' == '/help' goto usage

sqlcmd -S %1 -d %2 -E -b -i "MyScript.sql"
if %ERRORLEVEL% NEQ 0 goto errors

REM: More scripts...

goto finish

REM: How to use screen
:usage
echo.
echo Usage: MyScript Server Database
echo Server: the name of the target SQL Server
echo Database: the name of the target database
echo.
echo Example: MyScript.cmd MainServer MainDatabase
echo.
echo.
goto done

REM: error handler
:errors
echo.
echo WARNING! Error(s) were detected!
echo --------------------------------
echo Please evaluate the situation and, if needed,
echo restart this command file. You may need to
echo supply command parameters when executing
echo this command file.
echo.
pause
goto done

REM: finished execution
:finish
echo.
echo Script execution is complete!
:done
@echo on

--------------------------------------------------

HTH
tamatem wrote:
I have build a long sql data load script. What is the best way to do
Testing of the script? I would like to automate the test!
Oct 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: chris | last post by:
i have apache, mysql and PHP setup on my pc for development purposes and i can run the scripts fine - except when it comes to the mail() funtion what is the easiest way to set it up so i can send...
2
by: Michael Melvin | last post by:
Hello all, I just want to throw this out here as an idea I have and wanted some input and/or direction. I am currently working as a software developer and we have run into an issue with our...
1
by: Jim Hefferon | last post by:
Hello, Does anyone have suggestions for unit testing CGI scripts? For instance, how can I set the FieldStorage to have certain values? Do I have to go with a dummy FieldStorage class? And is...
2
by: Konstantin Zakharenko | last post by:
Hello, Our QA team have running a lot of test scripts (for automated regression testing), they run them on the different databases (Oracle/MS SQL). Several of those tests are dependent on the...
3
by: sviau | last post by:
whats the best way to test the load on the website which is similar the live load. we havea high traffic website (6 million page views per day). how can i use the iis logs from the live site; to...
1
by: Performer | last post by:
I need to test that an application using MS Access as the front end can support up to 30 concurrent users. The front end is MS Access on the client machine running Windows XP and the database is on...
18
by: Andrew Wan | last post by:
I have been developing web applications with ASP & Javascript for a long time. I have been using Visual Studio 2003.NET. While VS2003 is okay for intellisense of ASP & Javascript, it's still not...
4
by: David | last post by:
Hi list. Do test-driven development or behaviour-driven development advocate how to do higher-level testing than unit testing? types of testing: unit integration system
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.