Q:

how to check whether user is admin

I want to block functionality of my client application if user is not admin. But the problem is how to check in program that login and password was admin's?

A:

I'm assuming two things:

You want to know whether the logged-in user is an administrator or not in the SQL Server context.
There is some role which all "administrator" users belong to, such as for example db_owner. (Sorry, I don't have SQL Server in front of me and don't remember all the role names off the top of my head, so I'm pulling one that is close enough out of the MSDN documentation page example.)

If these assumptions hold, then it looks like IS_MEMBER will work.

