|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
May the Fourth 2020 | |
Which of these is not a real vehicle in the Star Wars universe? | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
RANKX Ties I have a data set that looks like this: User Sales --------- -------- USA 1000 Japan 800 UK 800 Ghana 400 Australia 700 I want to create a SalesRank column using the RANKX() function. I enter the table and column for sales, but I want to ensure that I handle ties appropriately. Which value do I choose for the ties parameter if I want the ranking to look like this? User Sales SalesRank --------- -------- --------- USA 1000 1 Japan 800 2 UK 800 2 Ghana 400 4 Australia 700 3
Answer: Dense Explanation: In order to get the "3" to show up, the Dense parameter is needed. The default is SKIP, which would produce rankings of 1, 2, 2, 4, 5. Ref: RANKX() - https://docs.microsoft.com/en-us/dax/rankx-function-dax |
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 2017 - Administration |
AG Listener - Configured AG and windows cluster. However, seeing issues with creating AG listener. This is on a multisubnet. Have tried the options found in online and nothing seems to be working. The cluster does have rights to create DNS entries in the AD. I don't think it is access issue in AD. When i look at […] |
SQL Server 2016 - Administration |
Performance Help for transaction depenedency - Hi, Can anyone help me in fine tuning this or any other suggestions also.I have a table which will have a set of transactions and reference transactions if any. I am creating a job to purge transactions based on some conditions like date , full completed based on a status etc. If a single transaction […] |
How to skip duplicate record and keep on running until the end? - I used code below to insert data into a table from another table. INSERT INTO tUser (Name,Email) SELECT Name,Email FROM tUSER_NEW T WHERE T.EMAIL NOT IN (SELECT EMAIL FROM tUser) But, this code will stop running once there is a duplicate record. How to skip duplicate record and keep on running until the end? |
Scripting Query Store - I could not find such script but I am sure it should exist. If I want to ask a DBA of a particular database of a particular server to send me ALTER DATABASE etc.. script that would allow me run it and recreate his precise Query Store settings in my database. I want to just […] |
SQL Server 2016 - Development and T-SQL |
Pefromance help for transaction derrivation - Hi, Can anyone help me in fine tuning this or any other suggestions also.I have a table which will have a set of transactions and reference transactions if any. I am creating a job to purge transactions based on some conditions like date , full completed based on a status etc. If a single transaction […] |
MDS - Entity Sync - Error MDSERR300004 - Hi, In Master Data Services in Model X I would like to validate an entity ('consumer entity') by checking whether a specific attribute value exists in another entity ('validation entity'). This checking is done by adding a domain-based attribute to the 'consumer entity' from the 'validation entity'. With every new input in the 'consumer entity' […] |
Development - SQL Server 2014 |
How to create table dynamically using source txt/csv files in sql server table. - I have data in text files as attachments/below. SO header row position will be change and delimiter cama(,) semicolon(;) .. etc.. I need to load in each file as separate table from header and data only.. can you please give me solution any stored procedure /SSIS package code.. This is first file today date: […] |
SQL Server 2019 - Development |
Column encryption - Hi Experts , we want to encrypt sensitive information like ssn ,tax_id , phone no and address we are thinking of using column level encryption . But there are number of stored procedures which use this tables around 300 stored procedures few of them perform insert option and most of them retrieve information from these […] |
Collapse record and get the number of days - here is my data. I am trying to get the dates in single row like below. Any help appreciated. result I need |
Reporting Services |
One filter from multiple columns SSRS - Hi, how can I create a single filter in SSRS with multiple columns? Below is an example of a table I am currently using. I will like to have just a single filter with unique values of the above locations. Thank you |
Integration Services |
Have txt/csv files, but header need to find from which row it will start - I have data in text files as attachments/below. SO header row position will be change and delimiter cama(,) semicolon(;) .. etc.. I need to load in each file as separate table from header and data only.. can you please give me solution any stored procedure /SSIS package code to find header row and based on […] |
Package migration from version 6 to version 3 failed with error 0xC001700A - Forum, Im trying to execute and migrate a package which was developed in SQL 2012 on to a SQL 2008 server , i see the version mismatches from the error is there an alternative way to make it working ? . Im planning on having the BIDS installed and rewite the complete SSIS package. This […] |
COVID-19 Pandemic |
Daily Coping 28 Apr 2020 - Today's tip is to remember that all feelings and situations pass in time. My thoughts: http://voiceofthedba.com/2020/04/28/daily-coping-28-apr-2020/ |
Daily Coping 27 Apr 2020 - Today's tip is: connect with nature. Breathe and notice life continuing. My thoughts: http://voiceofthedba.com/2020/04/27/daily-coping-27-apr-2020/ |
Daily Coping 24 Apr 2020 - Today's tip is: Thank three people you’re grateful to and tell them why. My thoughts: http://voiceofthedba.com/2020/04/24/daily-coping-24-apr-2020/ |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |