Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jooorj
Posting Yak Master
126 Posts |
Posted - 2011-04-27 : 04:33:59
|
How to Get Current Table Used by user_name |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-04-27 : 05:04:53
|
Your question doesn't make sense. Please expand.--Gail ShawSQL Server MVP |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-04-27 : 05:22:01
|
Joorj, you are asking a lot of questions lately that have the answer in Books Online.Give Books Online a try!There is no "current" table used by a user. How do you decide which is "current" table in a multi-table join? N 56°04'39.26"E 12°55'05.63" |
|
|
eralper
Yak Posting Veteran
66 Posts |
Posted - 2011-04-27 : 10:28:39
|
If you mean to find the table name in a DDL trigger then you can use the EVENTDATA() and parse for object name like the sample at [url]http://www.kodyaz.com/articles/prevent-drop-table-using-sql-server-ddl-trigger.aspx[/url]-------------Eralperhttp://www.kodyaz.com |
|
|
Jahanzaib
Posting Yak Master
115 Posts |
Posted - 2011-04-27 : 10:54:11
|
SELECT ST.TEXT,SP.CMD,SP.LOGINAME FROM SYS.SYSPROCESSES SPCROSS APPLY SYS.DM_EXEC_SQL_TEXT(SP.SQL_HANDLE) STWHERE ST.TEXT LIKE '%YOUR TABLE NAME%'Regards,Syed Jahanzaib Bin HassanMCTS,MCITP,OCA,OCP,OCE,SCJP,IBMCDBAMy Blogwww.aureus-salah.com |
|
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2011-04-27 : 10:59:53
|
Jahanzaid, did u read the question ?--------------------------http://connectsql.blogspot.com/ |
|
|
|
|
|