@echo off
sqlcmd -S (local)\sqlexpress -Q ^
"if exists( select * from fn_my_permissions(NULL, 'SERVER') where permission_name = 'CONTROL SERVER') print 'You are a sysadmin.'"
Wednesday, September 4, 2013
SQL Server Express: Batch file to check if current user is sysadmin
issysadmin.bat
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment