 | A community of more than 1,600,000 database professionals and growing |
| Featured ContentsFeatured Script |
| 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.comJoin the debate, and respond to today's editorial on the forums |
|
| |
| |  | David Fundakowski from SQLServerCentral.com Unit test stored procedures in Visual Studio using an existing database or new SQL scripts More » |
 | 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 » |
 | 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 EncryptedDavid Postlethwaite from SQLServerCentral BlogsBy David Postlethwaite Always Encrypted is new features in SQL Server 2016 and it is also available in Azure SQL Database.... More » |
 | 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 » |
|
|
| | 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. |
|
|
| |
| 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 |
|
|
| | 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 |
| |
| 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 |
|
|