Microsoft SQL Server Management Studio 2017 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 2017.
Questions tagged [ssms-2017]
188 questions
-1
votes
1 answer
T-SQL Merge with multiple options in Matched scenario
So I did some digging around on this site and no dice except for a case statement to update two columns in SQL Merge. I have another issue. Can you do two option in a matched scenario? I want to do an Update and an insert on a When Matched. Is this…

Tdubs
- 29
- 7
-1
votes
2 answers
Convert NVARCHAR DATE to DATETIME using CHARINDEX
I am getting the following error when trying to convert nvarchar column to datetime.
Select *
from table 1
where
convert(datetime, col1) >= '2018-08-29 00:00:00.000'
Error message
The conversion of a varchar data type to a datetime data type…

Becky Purland
- 89
- 10
-1
votes
2 answers
Can't connect to SQL Server database server on port 1433
I am trying to start scripting PowerShell SQL queries for a task, but before that i am testing to make sure my DB connection works.
I already created a table in SQL Server using SSMS 17, and as part of connection test, I am testing if I can connect…

Cataster
- 3,081
- 5
- 32
- 79
-2
votes
1 answer
SQL grouping together so data does not repeat
Have data in a table, and trying to query it out so the data reads for example like Motrin | mg | 25 | 4 | day | Pain, in one row. from the image...i have them all under the Answer column. My query that i have brings them all out...but it repeats…

Lern2LveWithIt
- 41
- 7
-2
votes
1 answer
How to get the average time per second from a date column in SQL?
I have a date column called OrderDate that I use to track insert time.
It will look like this:
I need to be able to use this OrderDate column and get the average inserts per second. So for example there are 3 inserts per minute happening.
How can I…

CodeMan03
- 570
- 3
- 18
- 43
-3
votes
1 answer
SQL restore is failing with an error when using SSMS
SQL restore is failing with an error with the below error. The backup is from 2008 and tried on 2017 and 2017 express, it fails. The .bak size is 100 MB.

SNew
- 109
- 1
- 2
- 10
-3
votes
2 answers
Minutes between dates when multiple records
Table 'audit' has fields id, old_status, new_status, & changed_at. Status contains values Open, On Hold, and Closed. I want to determine how long audit was On Hold, simple calculation:
SELECT Datediff(minute, (SELECT Min(changed_at)
…

Sammer
- 145
- 2
- 11
-4
votes
1 answer
Find the Min and Max date from two tables from a sql select statement
Cant seem to wrap my head round this problem.
I have two tables one which has the following sample values:
Second table had the following values:
What i am trying to achieve is like the following:
So you can see the first table has the modules,…

user6667537
- 13
- 2