SQL Server/T-SQL Tutorial/User Role/USER ID
Check user id with user_id() function
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>
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>