Questions tagged [ssms-2016]

Microsoft SQL Server Management Studio for SQL Server 2016 is a graphical tool for configuring, managing, and administering all components within Microsoft SQL Server. Use this tag specifically for questions related to Microsoft SQL Server Management Studio for SQL Server 2016.

172 questions
1
vote
3 answers

How can I get the count of inserts per minute in SQL

I have a table that looks like this id name CreatedDate 1 test1 2014-06-30 09:00:00 1 test2 2014-06-30 09:01:10 1 test3 2014-06-30 09:01:23 1 test4 2014-06-30 09:01:43 1 test5 2014-06-30 09:02:02 1 test6 2014-06-30…
Terrance Jackson
  • 606
  • 3
  • 13
  • 40
1
vote
0 answers

Unable to open ssms exe file

I have successfully downloaded and installed the developer version of SQL server 2019. Then I went to the SSMS website and downloaded the latest version of SSMS. The exe file was properly downloaded and it is not damaged at all. When I…
1
vote
1 answer

Dynamic multiple PIVOT on numeric column

I have a table having data like And I want to pivot category(which can increase/decrease) column with period column and also want sold_amt, purchase_price, gross_profit as row, please see required image like Thanks in advance. Please find create…
Dev
  • 357
  • 2
  • 11
1
vote
2 answers

SQL Rows with intended duplicate IDs - How to join them up?

I've got some user and department tables that are joined together, but with the option on the front end to include multiple "Leader" email addresses. Ideally, I'd like to keep these separated out on the main dataset; however, on the reporting view,…
1
vote
2 answers

How to compare dates from previous rows and update entries in SQL Server

I've been pulling my hair out in an attempt to find a way of updating some entries by comparing the dates from previous rows. Here's a sample of the date stored in the table I am willing to update: ContractId PartnerId DocumentState DealsDate …
Liviu Anca
  • 47
  • 7
1
vote
3 answers

GROUP BY T1.* ? Group by all columns in Table1, joined left by table 2, and Aggregate functions on T2 columns?

I have a query that is merging 2 tables. Table 1 has many columns, and may eventually expand. Table 2 also has several columns, but I will be performing aggregate functions on 90% of its columns. Table 1 has 300 + rows, Table 2 has 84K +…
1
vote
2 answers

SQL pagination very slow with multiple Left Joins

I have a stored procedure that I have to use pagination on in order to get records for a grid. The query works fine for a single table however once I start adding in left join things get slower and slower. A simple query to page 10 records takes 1…
Terrance Jackson
  • 606
  • 3
  • 13
  • 40
1
vote
2 answers

Loop through multiple tables to see if a column exists?

I have a temp table that holds a list of table names I need to loop through these tables to see if this column exists. If not then print out the table where it doesn't exist So far I have CREATE TABLE #ListOfTables ( [TableName]…
Terrance Jackson
  • 606
  • 3
  • 13
  • 40
1
vote
1 answer

Select subset of duplicate records in SQL Server

I need to select a subset of duplicate records in SQL Server 2016. Below is the data set and the code used. I need to select only duplicates highlighted in red. Basically I need only those duplicate records that have matching LName, FName,…
Data Engineer
  • 795
  • 16
  • 41
1
vote
1 answer

SQL Server LocalDb ProjectsV13 Connection Failure

Using SQL Server 2016 (localdb)\ProjectsV13, I created a database - let's call it MyDatabase. All was fine and dandy until I decided I no longer needed it... So in SSMS 2016, while connected to (localdb)\ProjectsV13, I right clicked on MyDatabase…
1
vote
3 answers

Return multiple rows if condition satisfies for atleast one row

I am new to SSMS and I have a feeling this should be easy but I have no clue on how to do it. For the sake of simplicity, I renamed my tables. SKU Reason s1 r1 s1 r2 s1 r3 s2 r1 s2 r3 s3 r5 s3 r1 s3 r4 To give a context, SKU 's1' is…
user1982519
  • 515
  • 5
  • 24
1
vote
1 answer

Even splitting of a group to within 1%

I have been tasked with taking a group of customers and splitting them into two equal groups for each store location. The result set requested would have the two groups for each store location within 1% of each other on customer count, within 1% of…
Chad Portman
  • 1,134
  • 4
  • 12
  • 38
1
vote
1 answer

T-SQL - Group by Style

In SSMS, I have an Orders fact table which looks like this: Orders ID GroupKey OrderID Amount DaysKey ---------------------------------------------- 1 29 29422 23.93 14 2 29 29444 -13.28 101 3 …
SUMguy
  • 1,505
  • 4
  • 31
  • 61
1
vote
1 answer

Is it possible to revert file open behavior of SSMS 16.* to the SSMS 2012 behavior?

SSMS 2012 used to open a script from shell integration in a new tab, re-using the session to the currently selected DB in the explorer, or the current tab's session. The new version opens an entire new instance where I have to make a new connection…
ajeh
  • 2,652
  • 2
  • 34
  • 65
1
vote
1 answer

Access not going to new record

I have an access app that is quite complicated and old, and really shouldn't be in access at all. I am trying to add a new form. I copied the old form and changed the SQL table names to the new ones. I added test data in SQL and everything looks…
user6906550