-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Latest Blog Posts

Powershell Error – Import-Module AzureRm

I was playing with SQL Azure on my brand new Surface pro device.  I open the Windows Powershell ISE as administrator to import AzureRm module by running the below command;

Import-Module AzureRm

It returned this error:

PS C:\windows\system32> C:\Users\User\Desktop\Azure Script.ps1
File C:\Users\User\Desktop\Azure Script.ps1 cannot be loaded because running scripts is…

Read more

0 comments, 59 reads

Posted in SQL Geek on 19 September 2018

ExpressRoute and VPNs in Azure

In this edition of Azure Every Day, I’d like to discuss networking and interacting between your data center and Azure. Two options you have are ExpressRoute and VPNs and I’d like to point out some reasons why you may choose one option over another or use a combination of both. Read more

0 comments, 64 reads

Posted in DataOnWheels on 18 September 2018

Don’t Just Rely on Query Execution Stats for T-SQL Execution

I recently had an incident where I was looking into the cause of a long running process for a client. It was a batch process that ran overnight, and execution time had been growing until it was now taking over 4 hours.

The database involved is a kind of staging… Read more

0 comments, 56 reads

Posted in Matthew McGiffen DBA on 18 September 2018

PASSITON discount code for PASS Summit 2018

This week only PASS has a new discount code of PASSITON for an additional $200 off 3-day registration. This is in addition to registration going up next by $200 gives $400 off if registered by Friday.

Also, everyone who registers by Friday will be entered into a daily prize draw Read more

0 comments, 41 reads

Posted in The Smiling DBA on 18 September 2018

The Trigger Roundup–T-SQL Tuesday #106

This month was my turn to host T-SQL Tuesday. I chose Trigger Headaches or Happiness as the topic, and I am glad that there have been quite a few responses.

I started the review almost immediately,and here are a few highlights. I separated these based on how I first thought… Read more

1 comments, 120 reads

Posted in The Voice of the DBA on 18 September 2018

New Whitepaper: Architecting Microsoft SQL Server on VMware vSphere

(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan - you get a weekly email packed with all the essential knowledge you need to know about performance tuning on SQL Server.)

Last week VMware has released a new whitepaper with the very promising title “Architecting Microsoft SQL… Read more

0 comments, 88 reads

Posted in Klaus Aschenbrenner on 18 September 2018

Announcing the 5th Edition of SQL Server 2017 Query Performance Tuning

I am quite excited to announce that the latest, most up to day, and by far the largest, copy of my book on query tuning is now available. 900 pages of information on how to improve the performance on your Azure SQL Database and SQL Server instances has been published.… Read more

2 comments, 80 reads

Posted in The Scary DBA on 18 September 2018

sp_translate, A Universal Translator in SQL Server. Just One Example Of How Powerful the Python/SQL Partnership Can Be.

In my recent post, Installing External Modules into SQL Server’s Python I had a look at just how simple it is to import external modules into Python so that they can be used within SQL Server.

In this post I’d like to show you a little something to demonstrate how… Read more

0 comments, 79 reads

Posted in SQL Undercover on 18 September 2018

Check if any database has auditing configured


Here is a DMV script to check whether a or any database has the auditing configured and running, along with few other useful attributes if it does.


Few things to keep in mind:

  • Auditing is available from SQL version 2008 and up....
  • Until very recently (SQL version 2016 and up),…

Read more

0 comments, 51 reads

Posted in Mission: SQL Homeostasis on 18 September 2018

Find Orphaned databases in SQL Server

Do you ever wonder if there are any databases in your environment that may just be there but not being used?

I needed to make a comprehensive list of such databases in order to clean up old databases and prep old/existing environment and migrate and consolidate them into a…

Read more

0 comments, 59 reads

Posted in Mission: SQL Homeostasis on 18 September 2018

Find Most executed queries

SELECT TOP 50
QueryState.execution_count
,OBJECT_NAME(objectid)
,query_text = SUBSTRING(
qt.text,
QueryState.statement_start_offset/2,
(CASE WHEN QueryState.statement_end_offset = -1
THEN len(convert(nvarchar(max), qt.text)) * 2
ELSE QueryState.statement_end_offset
END - QueryState.statement_start_offset)/2)
,qt.dbid
,dbname = db_name(qt.dbid)
,qt.objectid
FROM sys.dm_exec_query_stats QueryState
CROSS APPLY sys.dm_exec_sql_text(QueryState.sql_handle) as qt
ORDER BY QueryState.execution_count DESC

Read more

0 comments, 38 reads

Posted in TSQL Circle Live on 18 September 2018

Extracting JSON Values Longer Than 4000 Characters

A while back I built an automated process that parses JSON strings into a relational format.

Up until recently this process had been working great: my output table had all of the data I was expecting, neatly parsed into the correct rows and columns.

Last week I noticed an error… Read more

0 comments, 70 reads

Posted in Bert Wagner on 18 September 2018

Get all queries running against any specific table

/*
Get list of all queries hitting any specific tables
*/
SELECT DISTINCT TOP 100
ProcedureName = OBJECT_SCHEMA_NAME(sqlTxt.objectid) + '.' + OBJECT_NAME(sqlTxt.objectid)
,SQLStatement = SUBSTRING(
sqlTxt.Text
,(QueryState.statement_start_offset/2)+1
,CASE QueryState.statement_end_offset
WHEN -1 THEN DATALENGTH(sqlTxt.text)
ELSE QueryState.statement_end_offset
END - (QueryState.statement_start_offset/2) + 1
)
,DiskReads = QueryState.total_physical_reads --- Disk reads
,MemoryReads = QueryState.total_logical_reads…

Read more

0 comments, 46 reads

Posted in TSQL Circle Live on 18 September 2018

A Summit Contest for registering by Sept 22

If you haven’t registered for the 2018 PASS Summit and plan to go, you might press to get registration done this week. Next week prices increase, but this week you can save.

There is a promotion from PASS that will let you save $200 this week. In addition, you can… Read more

0 comments, 133 reads

Posted in The Voice of the DBA on 17 September 2018

SQL Substring function in SQL Server

The requirement of data refactoring is very common and vital in data mining operations. In the previous article, you’ll learn the tips for getting started with SQL string functions, including the SQL substring function for data munging with SQL Server. … Continue reading

Read more

0 comments, 112 reads

Posted in PowerSQL By Prashanth Jayaram on 17 September 2018

4 Usage Scenarios for Bots

So, what do you really know about bots or how they can help your organization? You may be thinking, Pragmatic Works is all about data, why would they be excited about bots? Because interacting with your data is what bots is all about. With them, you can interact with your… Read more

0 comments, 82 reads

Posted in DataOnWheels on 17 September 2018

Deleting a User that Owns a Schema

This was an interesting question I saw posted recently. Through SQL Server 2000, trying to delete a user that owned objects was a pain. We had to actually rebuild all the objects, which was problematic. With SQL Server 2005 and later, we got schemas actually added as separate entities, so… Read more

0 comments, 119 reads

Posted in The Voice of the DBA on 17 September 2018

Learn about SQL Source Control in Redgate University

I love the SQL Source Control product from Redgate. It’s not perfect, and it can be slow to run at times, but the simplicity of what it does, of getting my code quickly and easily to a VCS is fantastic. I really appreciate it.

This is one of the tools… Read more

0 comments, 111 reads

Posted in The Voice of the DBA on 17 September 2018

Query Store and Log Backups

A question that came up recently around Query Store is what happens when there are log backups in use on the database. Let’s talk about it. Query Store and Log Backups The core of the answer is very simple. Query Store, like any other data written to a database, whether… Read more

3 comments, 84 reads

Posted in The Scary DBA on 17 September 2018

How do I grant permissions to view users and their permissions?

tl;dr; VIEW DEFINITION

Every now and again you’ll have a user that needs to be able to see what permissions other users have. Not change them, just look at them. In the cases I’ve seen it’s usually a manager or something similar reviewing the database permissions. Or maybe someone doing… Read more

0 comments, 65 reads

Posted in SQLStudies on 17 September 2018

Older posts