Find a procedure or table by name in SQL Server - sql-server

A month or so ago I somehow managed to get a tiny widget showing in SQL Server 2008 where I could type the name of the procedure/table (never searched for anything else) and it would bring a list of matching items. I could then right click on the one I wanted -> Click (I believe) "synchronize" and it would bring the said item in the Object explorer, from where I could do whatever.
The widget I'm looking for was part of SQL Server and i was able to pin it bellow the Object Explorer.
I've no idea how I found it and where it is, but it's extremely useful for fast searching of objects.
It was NOT a Select or an SQL statement of any kind.

The SSMSBoost add-in also provides such functionality.
Maybe some screenhots are helping to remember...
As already mentioned by Creep, it could also be RedGate SQL Search:

Use the 'Object Explorer Details' window (F7).
SSMS -> View - > Object Explorer Details

I think it could be one of those (free) products : redgate sql search or dbforge sql search

Related

Missing Schemas in Crystal Reports

A little bit of an odd issue here.
I have a database, hosted on SQL Server 2008 R2 (SP2), that has 10 different schemas that could be used for reporting purposes:
Please note, for company compliance reasons, I did redact this image to the bare essentials.
Now, when I go to create a report, and connect to the database in question, the only schemas that are presented to me are those starting with lm_:
Again, redacted...
Now, for the purpose of the report I need to build, I need to be able to select against tables that are in one of the ls_ schemas.
My question is, in Crystal Reports 2013, how do I make all available schemas visible for use in a report?
Other important things to note:
I am able to log into SSMS as the same account I am using to connect to the database in Crystal Reports, and am able to successfully run queries against the schemas in question.
The account I am connecting to the database as, in both SSMS and CR, has full administrative access/capabilities against all schemas in the database in question
Points 1 and 2 would suggest that this is not a security related issue
I am connecting to the database in CR through an ODBC connection created on my system through ODBC Data Source Administration (32-bit) - as a System DSN
The ODBC Data Source uses the same administrative account being used directly in CR and SSMS
Thank you in advance for your help. Please let me know if there is any additional information that I can provide to help solve this issue.
I faced similar issue few years back, and as per my experience it has nothing to do with database and it is within the crystal reports where a registry value is set to minimum value which will restrict the display of schemas or tables
Check below link which will show you the path to change registry.
forumtopics.com/busobj/viewtopic.php?p=1004707
I would suggest you to first take back up of the original data and then change the value
Maybe this:
On the menu bar, select File –> Options.
Click the “Database” tab.
Uncheck the “Stored Procedures” option.
Someone on another forum said that worked but he did not know why.
There is a setting in Crystal under File-->Options-->Database where one can set owner like %. Perhaps your Crystal install has an old setting limiting your visible schemas?
For any one in 2022 who is facing this problem. Check the following:
Open odbc, 32 bits odbc.
Select your datasource and click configure
Click details
Select Metadata tab
Uncheck Disable Schema support and click Ok.
Solved, this is tested and working

How can I determine the Stored Proc used on an SSRS page?

We have an SSRS Report Server (I don't know if the name "Report Sever" is peculiar to us or common to SQL Server report services (IOW, I don't know if we chose it, or Microsoft did)) that hosts various queries that users can run against our data.
I need to find out which query is being run, probably which Stored Proc, for a given report that is available.
I thought I could suss that out via the "View Source" from the page, but I see no "data source," nor the name of our connection, or such. In fact, I looked through the entire source and saw nothing helpful.
The "View Report" button is:
<td><input type="submit" name="ReportViewerControl$ctl04$ctl00" value="View Report" id="ReportViewerControl_ctl04_ctl00" />
...and the only other reference to it is here:
Sys.Application.add_init(function() {
$create(Microsoft.Reporting.WebFormsClient._PromptArea, {"CredentialsLinkId":"ReportViewerControl_ctl04_ctl01","ParameterIdList":["ReportViewerControl_ctl04_ctl03","ReportViewerControl_ctl04_ctl05","ReportViewerControl_ctl04_ctl07","ReportViewerControl_ctl04_ctl09"],"ParametersGridID":"ParametersGridReportViewerControl_ctl04","ReportViewerId":"ReportViewerControl","ViewReportButtonId":"ReportViewerControl_ctl04_ctl00"}, null, null, $get("ReportViewerControl_ctl04"));
});
Is there a way, either from the "View Source" or otherwise, where I can coax out the SP used to generate the report?
UPDATE
Spurred on by Steve Mangiameli's comment, I see that I have the following in my Start menu:
MS SQL Server 2005
SQL Server Business Intelligence Development Studio (BIDS)
MS SQL Server 2008
SQL Server Installation Center
MS SQL Server 2012
SQL Server Data Tools
I don't know which, of any, of these has value for me in this quest.
UPDATE 2
We do have a Visual Studio 2005 project named "Report Server" project with many .rdl files beneath the "Reports" folder. I thought this was a unique-to-us solution, but maybe not.
Even if this is the "Report Server" mentioned, though, I still don't know which .rdl file is the one that drives the report I can generate via our online Report Viewer page.
It would be nice if the report, when generated, had some reference to the name of the related .rdl file.
You're going to want to navigate either Report Manager or the Report Server to download the report. Once you have the .rdl file, open it in a text editor...it's just an xml file. Simply perform a find for "dataset" and inspect the dataset values. You will see the datasource, parameter and SP. Use this link to help you navigate the site.
Adding a better link with pictures. I'd do it myself but don't have access to cloud services here at work.
http://sql-articles.com/articles/general/download-export-rdl-files-from-report-server/
The easiest way is to use Sql Profiler. Run Sql Profiler, put a trace on your Sql Server and run your report. You'll then see the exact SQL statement that is hitting the server.

Azure SQL Data Warehouse ''NoCount' Error

I just got approved for the Azure SQL Data Warehouse Preview, and just finished "provisioning" my new server and database. I followed a link to a 'Getting Started' page from Microsoft (Get started: Connect ...), and read that the two best (only?) ways of querying the database were through sqlcmd and Visual Studio 2013.
I ignored this advice first, and fired up SSMS, connected to the database, and then tried to open a new query window. I immediately received the following error: 'Unable to apply connection settings. The detailed error message is: 'NoCount' is not a recognized option.' After clicking OK, the query window did open up, but many T-SQL statements did not work such as a simple:
CREATE TABLE dbo.tblTest (acct_id nvarchar(255) NOT NULL)
I would receive a 'Command(s) completed successfully.' message, however no table was created.
Ok, I fired up Visual Studio 2013, connect to my Azure SQL Data Warehouse, and open it up in SQL Server Object Explorer. I right-clicked the specific database, and selected 'New Query', enter the same T-SQL CREATE TABLE statement as above, then hit execute. Once I hit execute, I get the exact same error message as above. This time around I was able to open a new query window at least, but after attempting to execute the query I still get the 'NoCount' is not a recognized option error.
I'm completely new to data warehouses, and still very much a beginner with T-SQL and SQL Server as well. But, I haven't been able to find anything that would explain why I'm receiving these errors, and right now I'm basically at a standstill until I can understand what's going on. Any help is appreciated, thanks.
I've experienced this. Your connection isn't actually recognised as a SQL DW connection. I bet your query window is a .sql file, not a .dsql as it needs to be.
Go back into the Azure portal and use the link to connect using SSDT from there. You should get a connection in the SQL Server Explorer pane which looks different, and when you start a New Query based on it, you should get a .dsql window, not a .sql one.
Have you checked the version of SSDT that you are using? It sounds like you may be on a version prior to 12.0.50623, which doesn't take into account that SET NO COUNT is not supported by SQL Data Warehouse at the moment. Newer versions of SSDT have adjusted for this. We recommend updating SSDT here and then connecting using the SQL Server Object Explorer with the directions in our documentation.
I am running Visual Studio 2015 Enterprise, and what I had to do to get this error resolved was install SSDT October 2015 Preview in Visual Studio. The link I used is: https://msdn.microsoft.com/en-us/library/mt204009.aspx
Prior to installing this, I had the latest released version for VS2015...had to install the Preview to get it to work. Also, it solved the issue where I was not able to see ANY of the tables in the Azure Data Warehouse database - just a couple of views, which made querying difficult (could still get a list of available tables from sys.tables)
I hope this helps somebody!

How to put a description in an sql server database

I use SQL Server Express 2012 and have multiple SQL Server databases and sometimes it gets difficult to find out which is which. So I want to put a description on each database. But I am not able to find any such option in the management studio. Has anybody faced this problem and knows the solution
Got the answer now. We can use Extended properties.
Right click DBName in object explorer - > Properties -> Extended properties
In that I added "Description" under name and details under value. We can add more properties also if we want. Same can be done for Tables too
if you are using mssm you can use "Registered Server", that way you can name and describe them , even sort them in groups

SQL Server Management - Index propertiers keyboard shortcut?

While doing development in SQL Server Management Studio (SSMS), I frequently want to check the properties of a number of index on a specific table from within the Object Explorer:
Pulling up the index properties to see the columns included in the index, one can double-click the index name in Object Explorer, or alternatively use the Menu Key and then using Up to select Properties, and then hitting Enter.
I checked the SQL Server Management Studio Keyboard Shortcuts list, but did not manage to find the answer to my question.
Is there a one-key shortcut that could be used to pull up the index properties instead?
I have just tried to find any context menus registered in SSMS concerning Index in Object explorer, but unfortunately it looks like that it is 100% built dynamically. So it is impossible to assign a shortcut. Generally, you can assign shortcut on any command, that is registered as menu command in SSMS. But no luck here.
No, I don't believe so. Usually if someone wants that level of speed in accessing information about indexes, they'll just issue an sp_helpindex command in T-SQL or query sys.indexes for the information they want.

Resources