use sqlcmd for sql2005 and higher.