|
|
|
Forum Newbie
      
Group: Customers
Last Login: 15/06/2006 15:30:05
Posts: 19,
Visits: 95
|
|
I've written a couple of SQL user defined functions for my current forum that perform full text queries significantly faster than the monster SQL statement built in ConstructManualSelectStatement found in InstantASP.InstantForum.Business.Search.vb. I'd like to display the SQL statement that's executing on the webserver if possible instead of grabbing it qith sql profiler if possible. I've got syntax error and it's difficult to debug this way. is there an easy way to output the text query?
|
|
|
|
|
Supreme Being
      
Group: Customers
Last Login: 19/11/2007 22:07:59
Posts: 161,
Visits: 2,483
|
|
| If you're on a dev box and have source code, you should be able to just response.write it from anywhere in the app... Might need HttpContext.Current.Response.Write(...) depending on where you are in the app. That what you mean? <-- Didn't realilze there was any SQL generated within the code.
Al Bsharah Free Stores - http://www.aholics.com
|
|
|
|
|
Forum Newbie
      
Group: Customers
Last Login: 15/06/2006 15:30:05
Posts: 19,
Visits: 95
|
|
kinda, that's what I'd like to see.
I really just need to get a .net tutorial or a good book and I won't sound like such an idiot.
BTW, I tried that and it doesn't work where I'm at in the code but I'll figure it out.
Thanks for your help.
|
|
|
|
|
Forum Newbie
      
Group: Customers
Last Login: 15/06/2006 15:30:05
Posts: 19,
Visits: 95
|
|
I guess a better way to do this would be to add the full SQL statement that fails to the error exception handler so that this block of text also includes the full SQl statement:
Exception Type: System.Data.SqlClient.SqlException
Exception Message: Incorrect syntax near the keyword 'GROUP'.
Exception Source: .Net SqlClient Data Provider
Exception Target Site: HandleException
Any idea how to do that?
|
|
|
|
|
Forum Newbie
      
Group: Customers
Last Login: 15/06/2006 15:30:05
Posts: 19,
Visits: 95
|
|
...Didn't realilze there was any SQL generated within the code.
There's actually quite a bit of it.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 05/03/2006 22:37:30
Posts: 4,
Visits: 13
|
|
| I've found that SQL Profiler helps when trying to debug the executing SQL code. If you have access to run SQL Profiler you will be able to see the exact calls the application makes to the database. This was very helpful for me when I was porting our old forums over to the new package and I needed to debug my porting scripts. It helped me to see exactly how IF runs.
|
|
|
|