Today's download is one I use a lot. It's a script which converts a text file containing raw T-SQL to a format more readily consumed by programming code. I do a lot of task automation that embeds T-SQL, and this little script is invaluable.
Using the Windows explorer drag and drop file action, this script enables me to instantly convert a T-SQL script file which looks like this below,
DECLARE @return_value int, @query as nvarchar (4000), @myHTML nvarchar(max), @bit1green as nvarchar (4000), @bit1amber as nvarchar (4000), @bit1red as nvarchar (4000), @bit2 as nvarchar (4000), @bit3 as nvarchar (4000)
To a file whose contents contain the T-SQL, but in a programatically embedded form like this,
squery= "DECLARE @return_value int," squery=squery & " @query as nvarchar (4000)," squery=squery & " @myHTML nvarchar(max)," squery=squery & " @bit1green as nvarchar (4000)," squery=squery & " @bit1amber as nvarchar (4000)," squery=squery & " @bit1red as nvarchar (4000)," squery=squery & " @bit2 as nvarchar (4000)," squery=squery & " @bit3 as nvarchar (4000)"
Very simple, but also quite handy.
To use, just drag your plain text file containing your crafted SQL onto the script and then within moments you'll see you converted file appear with an additional .vbs extension.
Kind Regards,
Ian./