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
0
votes
0 answers
SQL Server Management Studio: Generating Select scripts for tables in Linked Server Objects causes columns to be repeated
I have SQL Server Management Studio v18.8 looking at a SQL Server 2019 database. When I right-click on a table in a Linked Server Object and choose to "Script table As Select To New Query Editor Window", then many of the columns are duplicated or…

Koughdur
- 43
- 1
- 7
0
votes
1 answer
Connection to SQL Server on non standard port using SSMS
I have a SQL Server in RDS in private subnet on port 1433.
I open a SSH tunnel and use local port 21433.
I am not able to connect it using SSMS if I give db host as localhost,21433 or .21433
Please advise what the connection string needs to be in…

forvaidya
- 3,041
- 3
- 26
- 33
0
votes
1 answer
calculate total sum from first month to the last month
How to calculate total sum value from first month to the last?
Example:
This is what I've tried, but it doesn't showing the output like the example above.
select
left(convert(varchar,txd.OPERATIONALDATE,112),6) MONTH,
sum(AMOUNTVALUE)…

Didit Praditya
- 1
- 1
- 4
0
votes
1 answer
SSMS View editor keeps removing '[' and ']' from server specification?
I have linked from one SQL Server to a remote SQL Server from within SSMS and from a new Query window can now successfully select data from the remote server using SQL like this;
SELECT * FROM [Server\Instance].Database.dbo.Table
But when I paste…

Malcolm Weller
- 11
- 3
0
votes
2 answers
Assign multiple values in declaration part
I need to achieve the results by providing multiple declaration values. How can it be done?
DECLARE @ID INT
SET @ID = 1 --instead I need to provide multiple values like @ID = 1,2,3
SELECT C.Name, C.EmployeeID
FROM Cases c
WHERE C.EmployeeID =…

panda jemstome
- 31
- 5
0
votes
1 answer
create a sql server job to fill a table from other table
I have a 2 tables, I want to set a job for filling table 1 with some data in table 2. but there are some other columns in table1 that are not in table2. these cloumns have constant value.
for example:
table1:
name, date,number (random)
table…

Afsan Rezaei
- 21
- 7
0
votes
1 answer
Tweaking incorrect syntax near the keyword 'UNION' and 'Top'
I very much appreciate your help on this one, would really like for someone to tell me why Select Distinct and UNION ALL errors and it appears that 'TOP' (1) also has some union issue with clause which I am not familiar with even after I have done…

Sweetcorn
- 15
- 1
- 8
0
votes
3 answers
Extract employee record based on certain criteria
I have a database of employees with their employment history in organization.
Sample Data -
+----+----------+------------+
| ID | Date | Event |
+----+----------+------------+
| 1 | 20190807 | Hired |
| 1 | 20191209 | Promoted |
| …

Aashish
- 1
0
votes
1 answer
How to use if else in SQL Server stored procedure
Stored procedure:
CREATE PROCEDURE validate
@blockID VARCHAR(255)
AS
BEGIN
IF @blockID = (SELECT blockID FROM block WHERE blockID = @blockID)
PRINT 'exists'
IF @blockID != (SELECT blockID FROM block WHERE blockID = @blockID)
…

ImNewBtw
- 87
- 6
0
votes
2 answers
How to modify index type in SQL Server?
I need to change the type of index from "Unique Key" to "index".
I`ve spent 2 days trying to drop and recreate it. Unfortunately, there are a lot of dependencies and the only way to fix my issue is to modify the existing index. SSMS visual editor…

Vlad Rovner
- 194
- 4
- 11
0
votes
0 answers
Wierd SQL Connectivity Issue
I am posting this question after being completely drained of any possible solution I could think.
I was working on a WPF application which was connected to a DB (provided via CONFIGs). Few months back, the DB was changed (let's assume initially the…

Gaurav Ahuja
- 885
- 1
- 7
- 11
0
votes
1 answer
I'm not able to see the Line number in the SQL Server 2017 Express, even if Line Number checked correctly
Here is the image of the option window with the Line Number Checked correctly
SQL Server 2017 Express Edition
Windows 10 64 bits
Following the below path
Tools --> Options --> Text Editor --> Plain Text --> Line Number
I tried multiple times…

Lauren
- 3
- 3
0
votes
1 answer
Altering a stored procedure not throwing "Invalid column name" error when that particular column is removed from the table in SQL Server
I have removed a column from a table which is referred in a stored procedure. When I alter that stored procedure, there is no error, but when executing it, an error
Invalid column name
is thrown.
I'm using SSMS 2017

M.Tamil
- 74
- 4
0
votes
1 answer
xml.node how to get value
I know (usually) how to export the data from XML using SQL Server and I have done so for the rest of the extract, I just can't figure out how to get the values to line up when cross applying the stuff inside the XML tags.
This works and returns the…

lookslikeanevo
- 566
- 1
- 5
- 14
0
votes
1 answer
T-SQL stored procedure add ALTER TABLE function
I have added these foreign keys in a table using an alter table function.
I would like to add these as one stored procedure so when I execute the stored procedure, it will run and add these foreign keys in my table. Any help? Thanks
ALTER TABLE…

Harris A
- 1
- 1