1. Added definiation of LOG variable as name of output file of isql.
2. Added -o $LOG to isql line.
3. Added the constant "QWERTY" to the select list that includes @@servername so that we can easily distinguish this line with grep.
4. Set SERVERNAME using grep and cut and the tick <`> quotes that put stdout into a shell variable.
5. Note the -d " " and -f 2 options for cut. The first make space the delimiter. The second says to take the 2nd field. It's the 2nd because there is a space before the first column of printed output.