This MSSQLTips tip provides a different way to monitor the databases.
Please read the latest MSSQL Tip: “Monitoring Databases changes using WMI alerts“.
Check out all of my tips here: http://www.mssqltips.com/sqlserverauthor/94/svetlana-golovko/.
This MSSQLTips tip provides a different way to monitor the databases.
Please read the latest MSSQL Tip: “Monitoring Databases changes using WMI alerts“.
Check out all of my tips here: http://www.mssqltips.com/sqlserverauthor/94/svetlana-golovko/.
This MSSQLTips tip will help you to audit your SQL Server licensing with PowerShell script.
Please read the latest MSSQL Tip: “Script to get CPU and Cores for SQL Server 2012 Licensing“.
Check out all of my tips here: http://www.mssqltips.com/sqlserverauthor/94/svetlana-golovko/.
In my 10th MSSQLTips tip you will learn about different ways to display objects dependencies and you will learn how to use provided scripts in your day-to-day work.
Please read the latest MSSQL Tip: “Different Ways to Find SQL Server Object Dependencies“.
Check out all of my tips here: http://www.mssqltips.com/sqlserverauthor/94/svetlana-golovko/.
In this tip I demonstrate how to create single SQL Server Reporting Services (SSRS) report that will display SQL Servers versions for all of the SQL Servers that are registered in Central Management Server.
Please read this MSSQL Tip: “Creating a multi-server query SSRS report using Central Management Servers“.
Check out all of my tips here: http://www.mssqltips.com/sqlserverauthor/94/svetlana-golovko/.
SQL Server provides different metadata views that can help developers in their work, but sometimes developers are not up to date with the latest system tables and views changes.
In this Q&A we provide the query to search for the specific text in the stored procedures, views or functions. This is the easiest way to search for the string in objects definitions:
SELECT OBJECT_NAME(OBJECT_ID) FROM sys.sql_modules
WHERE [definition] LIKE '%my_search_string%'Another way is using syscomments system table which was used in older versions of SQL Server:
SELECT OBJECT_NAME(ID) FROM sys.syscomments
WHERE [text] LIKE '%my_search_string%'Also, you can use OBJECT_DEFINITION metadata function:
SELECT name, type_desc FROM sys.all_objects
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%my_search_string%'
In this tip I explain how to make sure that you have only one database transaction log file and more than one data file using policy based management.
Please read this MSSQL Tip: “Using Policy Based Management for checking SQL Server database file extensions“.
Check out all of my tips here: http://www.mssqltips.com/sqlserverauthor/94/svetlana-golovko/.
Please read my next MSSQL Tip: “Using Policy Based Management for checking SQL Server database file extensions“.
Check out all of my tips here: http://www.mssqltips.com/sqlserverauthor/94/svetlana-golovko/.
Please read my next MSSQL Tip: “SQL Server Login Management using LOGINPROPERTY function”.
One of the most common DBAs tasks is databases backup and restore. We do this to test the backups, to refresh test databases, to migrate the databases etc. For some of the tasks we have scripts, for others we need to create scripts on the fly.
Here I would like to share with you a simple script that you will need to run in SQL Server Management Studio’s (SSMS) SQLCMD mode. This script will allow you to create the backup, copy the backup file and restore it on the different server – all from a single SSMS window.
Start new query in SSMS and under “Query” menu select “SQLCMD Mode”:
Run this script (replace host name and SQL Server Instance name for the source and destination variables):
Note, that I commented out the “MOVE” option. Remember to add it to the script if your destination database files’ locations are different from the source.
Get the script from the SkyDrive here.
Please read my next MSSQL Tip: “SQL Server Security Audit (Part 2): Scripts to help you or where can you find more information”.