Advertisement
tei219

check SQLServer version

Oct 4th, 2011
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.67 KB | None | 0 0
  1. /* @@version*/
  2. SELECT @@VERSION
  3.  
  4. /* serverproperty */
  5. SELECT  
  6.     SERVERPROPERTY('productversion') as ProductVersion,
  7.     SERVERPROPERTY ('productlevel') as ProductLevel,
  8.     SERVERPROPERTY ('edition') as Edition
  9.  
  10. /* @@microsoftversion */
  11. SELECT CONVERT(varbinary,@@microsoftversion)
  12.  
  13. /* sp_server_info */
  14. EXEC sp_server_info 2
  15.  
  16. /* xp_msver */
  17. EXEC xp_msver 'ProductVersion'
  18.  
  19. /* watch ERRORLOG! */
  20. declare @cmd nvarchar(200)
  21. select @cmd = 'type '+replace(upper(reverse(substring(reverse(rtrim(filename)),charindex('\',reverse(rtrim(filename))),100))),'DATA','LOG')+'ERRORLOG | findstr [Ss]erver' from master.dbo.sysfiles where fileid = 1
  22. exec xp_cmdshell @cmd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement