SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

Featured Script

The Voice of the DBA

More Open Data

Steve Ballmer retired from Microsoft almost three years ago. It seems like a small eternity, and since his purchase of the NBA Los Angeles Clippers, I haven't heard much about any ventures with which he's been involved. Apparently, he's spent some of his time, and quite a bit of money to build a site that discloses data about revenue and expenditures for the US Government. There's a piece in the NYT about this project, as well as a shorter Engadget summary of the site, which provide a short look at the project.

USAFacts.org is the site, and it's a treasure of data sets. I look at this as a really interesting way to examine data sets that might be more difficult to gather than you'd expect. The Data Act deadline takes effect in May of 2017, which should also provide another way for anyone to look at public data and perform an analysis. I am disappointed the downloads aren't working yet, but I hope that this will come soon, along with some sourcing information about where the data comes from and how it was gathered.

Having data sets to analyze is important for any organization. Certainly within our organizations we spend a lot of time producing reports and queries that help various people analyze data. In fact, finding, collating, cleaning, and organizing information can be a taxing proposition in any size organization. Our data sets and sources are so diverse and often inconsistently producing data that it's amazing at times that our organizations run well. It seems on a regular basis someone wants to rebuild the methodology used to gather and organize information. I am not surprised that I constantly find incorrect calculations in software because the basis we use changes too often.

The big issue for me is that so many of us are amateurs when it comes to analyzing information. There aren't many organized classes or a good structure for most data professionals to learn how to analyze data. We learn on the job, we make guesses and assumptions, and overall do a good job. However, data analysis is highly inconsistent from person to person. I'd like to see that change, and as I see more and more people blogging and talking about how they look at a particular data set, I hope more people are thinking about how to analyze information and how the choices we make for calculations, visualizations, and even ordering can affect how the results are interpreted.

I'm glad Mr. Ballmer has started this project, and I look forward to seeing how people might use this data and other data sets to provide some analysis of the world.

Steve Jones from SQLServerCentral.com

Join the debate, and respond to today's editorial on the forums

ADVERTISEMENT

Featured Contents

 

SQL Server Unit Testing in Visual Studio

David Fundakowski from SQLServerCentral.com

Unit test stored procedures in Visual Studio using an existing database or new SQL scripts More »


 

Introducing a DevOps Workgroup to Farm Credit Services of America

Additional Articles from SimpleTalk

If you are introducing DevOps workflows into a large organization, you’ll need to plan carefully and prioritize tasks, adapt, maintain a thick skin, communicate constantly, and ensure that all teams have a chance to contribute their solutions. Bob Walker explains how FCSA set up a DevOps Workgroup, its philosophy and its goals for improving database and application deployment processes. More »


 

What the heck is a DTU?

Additional Articles from SQLPerformance.com

Andy Mallon explains DTUs (Database Transaction Units) and the differences you might see between the documentation and practical usage. More »


 

From the SQLServerCentral Blogs - Always Encrypted

David Postlethwaite from SQLServerCentral Blogs

By David Postlethwaite Always Encrypted is new features in SQL Server 2016 and it is also available in Azure SQL Database.... More »


 

From the SQLServerCentral Blogs - Wait Statistics integration inside the Query Store in SQL Server vNext

Enrico van de Laar from SQLServerCentral Blogs

I remember writing an article about Query specific wait statistics being available inside execution plans in SQL Server 2016 SP1.... More »

Question of the Day

Today's Question (by Devendra Thakur):

The spatial data type was introduced in which version of SQL Server?

Think you know the answer? Click here, and find out if you are right.


We keep track of your score to give you bragging rights against your peers.
This question is worth 1 point in this category: Spatial Data.

We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the Contribution Center.

ADVERTISEMENT

Exam Ref 70-761 Querying Data with Transact-SQL

Direct from Microsoft, this Exam Ref is the official study guide for the new Microsoft 70-761 Querying Data with Transact-SQL certification exam, the first of two exams required for MCSA: SQL 2016 Database Development certification. Get your copy today from Amazon.

Yesterday's Question of the Day

Yesterday's Question (by Ben Kubicek):

When Redgate Data Tools are installed in Visual Studio 2017 Enterprise, what key combination can you use to auto format SQL statements?

Answer: CTRL+K+Y

Explanation:

CTRL+K+Y will auto format your SQL statements.

Ref: click here


» Discuss this question and answer on the forums

Featured Script

Database Refresh Sync

Jason Givens from SQLServerCentral.com

This script is useful when restoring\refreshing a database and you want to maintain the users, roles, and role members that existed before the refresh.  This is extremely useful when refreshing a dev\test database from production because dev\test databases may have additional users and existing users may have different role memberships.  This script will provide, with just a few clicks, a method of identify all users, roles, and role memberships that existed in the refreshed database before the refresh and allow you to add them back after the refresh.  The script will also help with the following:

1. Re-sync the SIDs for any users that have a login on the refreshed server but whose SIDs do not match.
2. Help you identify any new users or roles that exists after the refresh.
3. Provide a list of new users that do not have matching logins on the refreshed server.

There are a lot of comments throughout the code that help explain how to use the script.  The following is taken directly from the beginning of the script and describes the purpose and how to use the script:

This script will aid in restoring the different/special permissions that exists in a dev/test database
after a refresh of the database from a different source, such as production.  The script will help
identify users, roles, and role members that existed in the database BEFORE the refresh and it will
help create scripts that you will run to re-create all of those users, roles, and role members that
no longer exists after the refresh.  The final results will also help you re-sync users with logins
where the SID for the user and the login, on the refreshed server, do not match.  There will also
be help, and instructions for creating logins for any users that do not have an associated login
on the refreshed server.

To use this script, do the following:
    1.  Run this script, in the database that is going to be refreshed, BEFORE THE REFRESH.
    2.  Copy the results to a new query window on the same server where the refresh is taking place.
    3.  Restore\refresh your database
    4.  Run the script that you copied in step #2 above.  This will produce five result sets:
        a.  The first result set is a script that you will paste into a new query window, on the
            server you where you just refreshed your database.
        b.  The second result set will list any database roles that are now in the refreshed database
            that were not there before the refresh.  (This result set is for reference.)
        c.    The third result set will list any users that are now in the refreshed database that were
            not there before the refresh.  (This result set is for reference.)
        d.    The fourth result set will list any database role members that are now in the refreshed
            database that were not there before the refresh.  (This result set is for reference.)
        e.    The fifth result set will list any users in the refreshed database for which no login
            exists on the server.  The script that creates this result set includes information
            about correcting this.
    5.  Run the script that you just copied in step #4a above adn everything will be re-synced except
        for the users without associated logins.  You will have to handle that separately.

IMPORTANT:  There is one issue that will arise if the collation on your database is different than
            the collation of your SQL Server.  There are two locations where an error will appear
            when you run the script in step #4.  If this happens, simply click on the errors in the
            Messages window to go to the point of the errors and make the following changes:
                Error 1:    Change: SET @txt = 'WHERE name IN (SELECT name FROM sys.server_principals) '
                            To:        SET @txt = 'WHERE name COLLATE SQL_Latin1_General_CP1_CI_AS IN (SELECT name FROM sys.server_principals) '
                            (where the collation matches the collation of the SQL Server)
                Error 2:    Change:    SET @txt = 'AND name NOT IN (SELECT name FROM sys.server_principals) '
                            To:        SET @txt = 'AND name COLLATE SQL_Latin1_General_CP1_CI_AS NOT IN (SELECT name FROM sys.server_principals) '
                            (where the collation matches the collation of the SQL Server)

More »

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.

SQL Server 2016 : SQL Server 2016 - Administration

How to connect to another server and run using SQLCMd Mode Programmatically. - Hi, I want to join a database to another server node. But I need to run that in SQLCMD mode. In...


SQL Server 2016 : SQL Server 2016 - Development and T-SQL

Export data in XML to import into Word - Hi Folks, I am building a one-click application to export information from SQL Server 2016 in XML format that will be...

SSIS ForEach Column loop - I am trying to pivot a very very wide source table (not my design!) into rows in my destination table.  ...

Permissions - HI im having a few issues trying to set minimum permissions, for any table that has a trigger i can not...


SQL Server 2012 : SQL Server 2012 - T-SQL

Is there a best way to combine data into a single output field - I need to create output that takes a list of names and combines them into one field. Here is an...


Reporting Services : Reporting Services

Scaling Out SSRS -- Licensing - Hi folks, I did a search but couldn't find anything regarding "scaling" in the SSRS section. Sorry in advance for starting...


Reporting Services : Reporting Services 2008 Development

Reporting Services Error on Linked Server Executing Stored Procedure - Permissions issue? - Hi there We have Reporting Services webpage which processed accounts data from a SQL Server 2008 database and then loads this...


Reporting Services : SSRS 2012

Filtering with Parameters - I am stuck with something that I could not think of this moment.   See the data below. 1. I created a...


SQLServerCentral.com : Articles Requested

The OUTPUT clause - Looking for a couple articles here. One on basics of OUTPUT for inserts and deletes. One for updates and combining...

This email has been sent to newsletter@newslettercollector.com. To be removed from this list, please click here.
If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com.
This newsletter was sent to you because you signed up at SQLServerCentral.com.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.
This transmission is ©2017 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com