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

Byte Me: Taking it to the top

Bob Lang from SQLServerCentral.com

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

ADVERTISEMENT
Database DevOps

Library of articles for DevOps, DLM, & Continuous Delivery

Discover best practices and processes for more agile methods of database delivery. Find out how automating the build, test and deployment of database changes reduces risk and speeds up the delivery cycle. Read more on Simple Talk.

SQL Monitor

New SQL Monitor Reporting Module

SQL Monitor now includes a new Reporting module. It allows you to create customized reports, combining the individual server performance metrics available in SQL Monitor with summary information on your entire SQL Server estate. These reports can then be exported to pdf and emailed to you on a scheduled basis. Download SQL Monitor now and get a 14 day free trial.

Featured Contents

 

Stairway to Columnstore Indexes Level 12: Clustered or Nonclustered?

Hugo Kornelis from SQLServerCentral.com

The previous levels of this stairway describe details, features, and limitations of columnstore indexes in SQL Server. But they do not answer what should be the first question for every database professional: should columnstore indexes be used in my databases; on what tables should they be used; and should they be clustered or nonclustered columnstore indexes? More »


 

Masking your on-premise database with SQL Data Mask

Additional Articles from Redgate

In the last update from Redgate Foundry three weeks ago, they announced their intention to build a version of SQL Data Mask that would mask on-premise SQL Server databases, as well as Azure SQL Databases. They're pleased to say this version of the prototype is now available - here are the details. More »


 

Free eBook: Troubleshooting SQL Server: A Guide for the Accidental DBA

Press Release from Redgate

Three SQL Server MVPs (Jonathan Kehayias, Ted Krueger and Gail Shaw) provide fascinating insight into the most common SQL Server problems, why they occur, and how they can be diagnosed using tools such as Performance Monitor, Dynamic Management Views and server-side tracing. The focus is on practical solutions for removing root causes of these problems, rather than "papering over the cracks". More »


 

From the SQLServerCentral Blogs - Find the number of rows for a value, without querying the table

Dear all, Being a DBA, developers approach me with questions like can you run this query for me in production? Select*FROM[dbo].[FactInternetSales] WHERE UnitPrice... More »


 

From the SQLServerCentral Blogs - Using Azure Machine Learning with an on-premises Database

Enrico van de Laar from SQLServerCentral Blogs

With Azure Machine Learning (AzureML) you have access to a cloud based, flexible and friendly method to perform machine learning... More »

Question of the Day

Today's Question (by Steve Jones):

If I want to get a list of files in my current directory in R, how to I get this?

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: R Language.

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

Pro SQL Server Relational Database Design and Implementation

Learn effective and scalable database design techniques in a SQL Server 2016 and higher environment. This book is revised to cover in-memory online transaction processing, temporal data storage, row-level security, durability enhancements, and other design-related features that are new or changed in SQL Server 2016. Get your copy today from Amazon.

Yesterday's Question of the Day

Yesterday's Question (by Devendra Thakur):

Suppose you are running the following MDX script against Sample cube provided by Microsoft.

 SELECT FROM [Adventure Works]

It returns a numeric value (in my case $80,450,596.98). What it represents?

Answer: Super grand total of all the measures for all the dimension at all level.

Explanation:

When you run the above script it returns the super grand total of default measure for all the dimension at all level. Since you have not mentioned the measure system picks the default measure which can be defined during cube development in Sql Server Data Tool. Since there is no slice and dice condition, system sum the measure for all the values in dimension like for Product dimension it sum the measure for all the products in dimension table. System does the same for all the dimensions added to the Cube.

Ref: click here


» Discuss this question and answer on the forums

Featured Script

Compute Holiday Day of the Month for any Year

Eric Notheisen from SQLServerCentral.com

This script uses a common table expression to store the list of holidays for use in other processing.  You may add additional holidays as necessary.  I was using this CTE to compute the next business day as part of a batch process within an SSIS package. The fixed date holidays are unioned with floating date holidays to create a table that is computable regardless of the year.  The result looks like this:

Holiday Month DayOfWeek Holiday Celebrated Next Work Day
New Years Day 1 5 1/1/2015 1/2/2015
MLK 1 5 1/19/2015 1/20/2015
Presidents 2 1 2/16/2015 2/17/2015
Memorial 5 5 5/25/2015 5/26/2015
Independence 7 7 7/4/2015 7/6/2015
Labor 9 5 9/7/2015 9/8/2015
Columbus 10 5 10/12/2015 10/13/2015
Veterans 11 4 11/11/2015 11/12/2015
Thanksgiving 11 5 11/26/2015 11/27/2015
Christmas 12 6 12/25/2015 12/26/2015

The year selected in htis case was 2015.

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

Which command to reduce log fle ? - Hello Everybody, I have a question concerning Log File : I have to reduce Log file because it's Growing, I'm thinking, this...

RAM Required to run SQL Server + Web Application + SSIS packages - Production Server with following processes running:  REST API hosted in IISSQL Server with Data - Majorly for Time sheet and Other application...


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

when creating FK constraint get error 'statement conflicted with the FK constraint' - been away from development awhile and frustrated by inability to discover underlying issue preventing me from creating FK relationships.  The...


SQL Server 2014 : Administration - SQL Server 2014

backup after a restore. - I am using SQL server native tool to do the full, differential, transaction backup.   A question, every time if we do...

Different Query Plan for same query - Hello, I am having very interesting issue. On one SQL instance therea re 2 different databases. Now I am execuitng SQL...


SQL Server 2014 : Development - SQL Server 2014

Help with Performance on select count(*) SQL Server 2014 - Have 2 same databases one on test and one on dev in different servers. Whilst trying to run the same...

User-friendly names for constraints - I just noticed that when you create a column with a default value, a constraint is added to the table....

Calculate percentages based on if condition - Hi, I have a query and I need to implement logic to calculate percentages based on if condition in stored...

Reverse ouput - Hi, I am trying to summarize some rows and do a revese output Here is my table data CREATE TABLE mycompanytable(  Companyname         NVARCHAR(50) NOT...

Dynamic Statement with Cursor loop, help - Hi , I am trying to build a dynamic query which will create a select. I am trying to use a...


SQL Server 2012 : SQL 2012 - General

float to date - Hi I am trying to convert a "calendar date" column that is a float to date the "date" looks like 201601 ...

How to export particular table list from sql server 2005 DB - Hi , There is an  option to export list of tables in sql server. That is export/import wizard. Here actual scenario...

To Delete / Truncate / Drop & Create - Good Morning All, Can I Have some opinions please. Have 2 large tables I need to 'clean', 1 with 265263333 rows and one...


SQL Server 2012 : SQL Server 2012 - T-SQL

Highest value supported by 2 of 3 columns - Consider a table consisting of an ID number and 3 columns of scores (Score1, Score2, Score3).  The final "score" for...

t-sql 2012 parse out multiple values in one field that is varchar(1200) - In a t-sql 2012 database, I am suppose to count the number of times each 'canned' message is used for Elementary...


SQL Server vNext : SQL Server 14 - Development

BEFORE TRIGGER Idea Posted to Microsoft Connect - I have wished for SQL Server BEFORE TRIGGERs for a long time. I have posted to Microsoft Connect (their feedback...


SQL Server 2008 : SQL Server 2008 - General

How to delete all store procedure from my database ? - I'm using SQL Server 2008 and its Management Studio. I'd like to delete all user defined stored procedure & views. Is there any...

How to delete all tables except two specific tables ? - I want to remove all tables except two table i.e  mytable1 and mytable2 in my db. Is there any script to do...


SQL Server 2008 : T-SQL (SS2K8)

Looking for best approach - I have two tables. I am looking for an approach where 1)I need to display the data from Table1 if table...


Cloud Computing : SQL Azure - Administration

Azure data warehouse - Index maintenance - Hello Folks, How do you perform/schedule index maintenance on Azure Data warehouse. Is there an option to view index fragmentation details...

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