check database version sql server code example Example: sql version query SELECT @@VERSION AS 'SQL Server Version';