Given a database type string of varchar(30)
, I would like to standardize it for SQL Server by capitalizing the type name and putting it in brackets. The desired result is [VARCHAR](30)
.
How can I convert $1 to uppercase? This expression identifies the type and adds brackets, but is does not ToUpper().
PS> "varchar(30)" -replace '^\[*(\w+)\]*(.*)','[$1]$2'
[varchar](30)