Can I alter the "Execute Procedure" pop up window in SSMS? - sql-server

My boss would like to see an example of the data type when executing stored procedures.
When you execute a stored procedure, a popup window appears showing parameter,data type, output parameter, pass null value and value. For example, if the parameter and data type is a date he wants to be able to visually see on that screen what format the date should be entered "YYYY-MM-DD", "YYYY-DD-MM", etc.
If the parameter was customer name and the data type is nvarchar(128) he wants to know what that would look like. Ideally, I would like to insert a new column on this popup that shows an example of the intended format. I'm just not sure if it's possible.
I've searched on google and stack overflow for SQL user interface changes, SQL
formatting tools and altering stored procedures. So far I've seen are articles from Microsoft on Graphical Query Designer User Interfaces, Apex SQL Refractor, and posts on this site that are not quite what I'm looking for.
I'm not sure my boss would want me to share my company's code online.
I've only been working with SQL for a few months so I'm not super familiar with how to alter things, only how to query and organize the results so any help would be appreciated. Below is what the popup window looks like currently.

Related

Querying the Audit Log through Database [SQL Server]

I would like to take the Audit History provided by Enterprise Architect and create a SQL query to report through a BI tool that will allow myself and other users to search the history of an object but I am having a little trouble understanding the audit table: t_snapshot.
From what I can tell, t_snapshot has a Style column that contains "INSERT," "UPDATE," and "DELETE" which would tell me what is happening and the Notes column can tell me what object it is referencing but so far I've only been able to get a partial picture. What I have not been able to deduce is when any event occurred or which user made the change.
If anyone has encountered this problem in the past, your input would be appreciated.
Well, I don't know whether you really want to touch that.
There's a column called BinContent which contains what you are looking for. It looks like
<LogItem><Row Number="0"><Column Name="object_id"><Old Value="1797"/><New Value="1797"/></Column><Column Name="name"><Old Value="CB"/><New Value="CBc"/></Column><Column Name="modifieddate"><Old Value="07.12.2018"/><New Value="11.12.2018"/></Column><appliesTo><Element Type="Action"/></appliesTo></Row><Details User="Thomas" DateTime="2018-12-11 08:22:59"/></LogItem>
So basically some XML describing the change including the plain text user name.
The bincontent column(s) are actually zips which contain a single file str.dat holding the above information.
Good luck.

User Interface to analaze date of a conventional rdbms

Currently we create Jasper PDF Reports from a single simple database table for our customers. This has been achieved programmatically. It's static. If the user wishes to change the query, he/she creates a change request, which we cannot deliver before the end of the next sprint (SCRUM).
The tool/library should be straight forward (e.g. convention over configuration) and employable from within a JavaEE container. And, open source.
Is there a dynamic tool that allows or customers to create the simple queries/reports themselves without knowing SQL? Means, they should be able to see the table and then create a query from it, execute and print (we could use Jasper Reports for the last one).
E.g. Select only data from year 2014, aggregate them by customer group and select columns x,y and z.
All of these criterias and query structure may change though, thus not just the value like year 2014.
Questions:
1) Is there a tool that presents the data in some kind of SAP-cube or something similar where the user could select the structure and attributes?
2) Can that tool save template queries (queries that the user has invoked before)?
thanks
With BIRT you could use parameters in the report... for example have one report that shows the whole data set or data cube (or at least a bit of all of the fields). Then you could add JavaScript to the report (or do all of the presentation in JavaScript for that matter), that shows the parameters a user can select from. These parameter values can then either be sent to a new report or could update the existing report. Parameters can be put into database queries too.
If that was exposed in JavaScript on a web page you could save the parameter values to an array and store them in the browser or server.

SSRS - Passing parameter to run stored procedure

I have set up a report in SSRS which drills through to a 2nd report. The data in the second report is a stored procedure that has a parameter declared, as in:
CREATE PROCEDURE [dbo].[Procedure] (#Parameter VARCHAR(max)) AS.....
In the first report I have set up the Action on the text box properties to run the second report using the relevant parameter from the first report.
I am designing this in Visual Studio and when I 'Preview' the report in here it works correctly and the drillthrough passes through the parameter as intended. However when I deploy this onto our server and try to view the report using Internet Explorer the drill through doesn't work, I get an error saying that the parameter is read-only and cannot be modified.
From reading other posts relating to this online people have mentioned changing the parameter visibility to 'Visible' however this hasn't worked on mine.
Has anyone else experienced anything similar to this before?
Thanks.
This seems to be a common problem when passing a parameter to a subreport. Have you seen this solution? http://saiabhilash.blogspot.nl/2012/05/report-parameter-is-read-only-and.html

SQL Server Profiler suddenly says Encrypted Text

Recently I noticed that a stored proc we are trying to profile failed to appear in the profiling output.
After adding in SP:StmtStarting and SP:StmtCompleted events, I noticed the TextData reported as
-- Encrypted text
.. but the stored procedure is not encrypted.
This has only recently started happening - we used to profile this SP perfectly fine, and I can't figure what has changed.
Any suggestions would be gratefully received.
UPDATE: The SP is definitely not encrypted. I've created new SP's on the box, and I see SP:BatchStarting event with the new SP's name. With the old SP, I don't see the BatchStarting event, but I do see the statements within the SP executing.
However I need to see the values of the parameters the SP is being called with, as they are table types. Originally I could see the table types being instantiated and populated before the SP is called.
So I figured this out in case anyone finds it useful.
I have table type parameters to this stored procedure. One of the parameters is passed a lot of data (i.e. a C# DataTable with >5000 rows). Without this quantity of data the stored proc profiled fine.
I guess there must be some cut-off at which point Profiler does not show all of the data being passed in.
Someone has altered the stored procedure and added the 'WITH ENCRYPTION' hint, which will cause this behavior. Alter the stored procedure and remove that hint and you'll start seeing the text of the proc again.
Also to note, if you don't have the original code, you will not be able to decrypt the text of the proc to issue the ALTER statement, so hopefully you have that handy.
Here's a decent run down of this option: Options for hiding SQL Server code
Moving the Trace Properties from the default of OnlySP(<your database here>)(user,default) to TSQL or TSQL_Replay unveiled the SQL being used for me, ... Go to File|Properties... and change the [Use the template:] drop-down combobox.

Easily find one stored procedure in SQL Server Management Studio from 1000 in treeview?

Our database is about to reach 1000 stored procedures. Although we were wise and created a good scheme for naming the stored procedures, hunting for the stored procedure you need can be a bit frustrating as you scroll and scroll and scroll. If I know the exact name of the stored procedure I'm looking for, it would be great to identify it quickly and modify
For example, if I want to find p_Blah_Blah in the treeview and open it to modify it, is there a command to launch p_Blah_Blah in a new window for editing? Or perhaps a plugin that limits the view of stored procedures to what you are searching for? Anyone who wants to write a plugin? :)
You can filter the tree, right click on "Stored Procedures" choose "Filter" and "Filter Settings".
As a general rule here we use naming conventions to do with context, for example all user sprocs are named: usp_user_*
Check out the redgate tools here, they have a free search tool that makes this kind of stuff a breeze:
http://www.red-gate.com/products/sql-development/sql-search/
In Management Studio 2005 you can right click on the stored procedures folder (and other folders too) to set a filter, then you can type in all, or part, of the names that you are looking for.
If you just want to know details of parameters (or rows for a table etc.) then in a query window you can type the objects name, highlight it, and press alt-F1 to call sp_Help on the object.
EXEC sp_HelpText 'your procedure name'
then proceed to modifying it.

Resources