Check user id with user_id() function : USER_ID « User Role « SQL Server / T-SQL Tutorial






4> IF (SELECT id FROM sysobjects WHERE id=OBJECT_ID('foo')
5>     AND uid=USER_ID() AND type='U') > 0
6>     DROP TABLE foo
7>
28.12.USER_ID
28.12.1.Check user id with user_id() function