fn_get_sql – developer edition | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

fn_get_sql – developer edition

I’m trying to trace a large query (> 255 char) on an instance of SQL 2000 developer edition (sp4 – 8.00.2039) and it does not appear that fn_get_sql is available? Is this function only available on standard and enterprise editions? Is there another way to capture the entire SQL statement (I need to see the where clause). Thanks

You could run a profiler trace. Can’t really say why fn_get_sql is not available – developer edition is essentially enterprise edition as far as I’m aware. I know this is a stupid question but are you preceding fn_get_sql() with two colons? (i.e. select * from ::fn_get_sql(@handle)). Karl Grambow www.sqldbcontrol.com
same problem check whether it help you
http://www.codecomments.com/archive352-2005-6-527484.html —————————————-
Cast your vote
http://www.geocities.com/dineshasanka/sqlserver05.html http://spaces.msn.com/members/dineshasanka

It’s not a matter of getting it to work properly, the function does not exist in the master database on the instance. I can’t see it in EM and when I try to call it in QA I get a function not found error message: DECLARE @Handle binary(20)
SELECT @Handle = sql_handle FROM sysprocesses WHERE spid = 127
SELECT * FROM ::fn_get_sql(@Handle) Server: Msg 195, Level 15, State 10, Line 3
‘fn_get_sql’ is not a recognized function name.
Can someone that has a developer instance installed let me know if they have the function? My standard and enterprise editions have it, but my one developer instance does not????
quote:Originally posted by SQLDBcontrol You could run a profiler trace. Can’t really say why fn_get_sql is not available – developer edition is essentially enterprise edition as far as I’m aware. I know this is a stupid question but are you preceding fn_get_sql() with two colons? (i.e. select * from ::fn_get_sql(@handle)). Karl Grambow www.sqldbcontrol.com

Doesn’t profiler have the same 255 character limit?
runs fine on my notebook with wxp & sql DE
Thanks JC, must be a problem with my instance.
Have a dev edition w/SP3a that has fn_get_sql…
]]>