Does sql profiler show you the paramater values that were passed in? - sql-server-2008

I'm using this 3rd party sql tracing application because I have sql server express 2008 installed (just a trial version).
It only shows the sql passed into the server, with the parameters like #p1 and not that actual value of the parameter, which to me is not all that usefull.
Does the built in sql profiler show you the actual values the .net web app is passing in like '2342' or a = 200 ?

yes, it shows the query with the parameters already substituted. When I debug, I usually just copy the SQL from the profiler and paste it into Management Studio and run it.

It can. When you define a profile template, you can specify which sql "things" you want to see and which columns (information) you want to see for each "thing". So if you aren't seeing the parameters, you may have to modify the profile template you are using.

Related

Check rendered SQL sent to the server from SSDT/SSRS

I'm building a report in Visual Studio Data Tools and I'm having trouble in passing a multivalued parameter to a DB2 LUW server.
How to check the rendered SQL string sent to the server?
You can use the SQL Server Profiler to see the actual query. Or you can catch it in the query monitor in SSMS.
If you post more details someone might be able to see what's wrong. It usually has to do with how the WHERE clause is written.

SSRS reports based on Getdate() function

I developed a report using the getdaye() function in the query. The report runs fine on SQL management Studio.
I created a report using the SQL server data tool and the report is based on the query that I wrote in SQL studio. I have established a connection using the data source and am able to connect to the SQL database. When I run the report using the tool after a couple of days the report data is different from the data that I get when I run the query using SQL management studio. Obviously the Getdate() is not fetching the right date.
The report data maches only when I copy and paste the query in the SQL server data tool and then run the report.
Am I doing anything wrong or should I use create a parameter for the date and direct the default values = Now() on the sql server data tool.
Is there any other work around for this.
Hem
I guess that did not publish the report to a Report Server but repeat to preview the result in Visual Studio (SSDT). SSDT caches data to improve the experience in SSDT and retrieves data from the database only when needed. "Needed" means that you either change the query or choose different parameters. You could of course pass a parameter to the database server, but if you don't want that, you will have to clear the cache from time to time. Look into the folder where the report is saved and delete the *.data file with the same name as the report. You can make this task very easy by adding a menu command to the tools menu as described here.

Reporting services error trying to access a object that isn't called in the report

have a strange one. We are running Sql Server 11.0.3000. The report is giving an error
An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset 'Audit_Detail'. (rsErrorExecutingCommand)
Invalid object name 'dbAudit.tblRangeReport'.
The thing is, the report uses 3 stored procs to go after data in a database called dbSalarySurvey. The three sp's do not mention the dbAudit.tblRangeReport. There are no functions or views in the 3 sp's that access that table. Further more, if i run the report in VS 2012 the report runs. If i run profiler on the dbAudit table when VS runs the report, the report does not query the dbAudit table. Only when running the report from the web browser do i get this error. This more detailed version of the error come from running the report on the Sql Server REporting services computer.
I have tried restarting the reporting services service. We have also deleted this one report from the reporting services server and republished it. Have also tried to republish the dataset. Other reports in this project that use the datasource and the same tables run.
Anyway, was wondering if anyone had any sugguestions.
Thanks
shannon
It's fixed. it was a pebkak error in the stored proc. It's really strange though. Honest to goodness, the proc was running in my dev env but not when running from a browser. I had already checked profiler like was suggested below and done the xml scan too. In the end.. just missed it i guess.
You need to trace the SQL to determine.
Are you connecting to the right database?
Are the procs you expecting to see, the ones actually being run?
The procs you are running are correct?
Open SQL Server Profiler
Start New Trace
Click Event Selection, Select the following events
Click - Show All columns
Go into Column Filters
and filter on your DB, and possibly even your login name (the login name of the SSRS server)
Once you've done that, call your report and look to make sure all the procs are called that you expect. Track issues from there.

SQL Server 2008 Debugger Attach?

I have seen a few posts here about using the native MSSQL 2008 functionality to debug and step through TSQL.
In a Visual Studio 2010 .NET C# console app, I use simple ADO.NET to send some params to a stored proc. I can run it in the debugger and see what happens in the .NET code up until the point where the SqlCommand is executed. How can I get the debugger (or any debugger) to fire on the MSSQL side so I can follow data from the C# all the way to/though the DB?
Thanks.
If you want to capture what is sent cross the wire, use SQL Profiler.
Using SQL Server Profiler
If you are having problems stepping into a stored procedure from Visual Studio:
How to: Enable Transact-SQL Debugging
Walkthrough: Debug a Transact-SQL Stored Procedure
[Please note: your mileage may vary; I've known systems where this just wouldn't work. So much so, I never try to step into TSQL any more...]

SSRS and MDX causes VStudio to crash

I am trying to generate a report using reporting services in visual studio 2005. the data source is in MDX DB and was created successfuly. When I save the query in the query builder window it closes and displays an alert : "the query cannot be read from the query window, please check for syntax errors"
and then VS crushes!
the query has no parameters and works on management studio without any problems.
I have installed all of my win updates, but sql server sp3 (that had a problem)
I also have service pack 2 for my framework
any idea what is going on?
try pasting from VS into notepad (or SSMS) and then copy from notepad (or SSMS) back into VS to make sure that there are not any "strange" characters (like smart quotes). It's vaugely possibly that SSMS is stripping these out when you paste into it.
Otherwise it may be an issue with your failed SP3 install.