Questions tagged [sql-server-2016]
SQL Server 2016 (major build version 13.00.xxxx). Please also tag sql-server.
2,784
questions
-2
votes
0
answers
27
views
SQL Server: Two MERGE statements are blocking each other on a large partitioned table
Have a large table partitioned on an INT column. When I run two different MERGE statements on two different partitions of this table, they seem to be blocking each other.
Example:
-- Large table ...
0
votes
2
answers
79
views
create_date and modify_date for sys.objects in MSSQL shows same date
I am trying to figure out when is the create date of a user defined object in the database.
but when I ran a select query on sys.sysobjects, it seems create_date is the same as modify_date.
Is this by ...
1
vote
2
answers
106
views
error when re-applying the permissions script into the original database - sql server
when I run the following script:
-- ——— SCRIPT GRANTS for Object Privileges—————
IF OBJECT_ID('[sys].[sysrowsets]') IS NOT NULL GRANT CONTROL on [sys].[sysrowsets] to [db_myrole_BA]
I get this ...
0
votes
0
answers
20
views
SQL server is already part of a cluster error; cannot re-add after removing offline SQL node
I'm new here but I've run out of options for my search on this issue my team is having. To give a relatively short backstory; I know almost nothing about SQL beside what I've learned from a short time ...
0
votes
3
answers
54
views
Alter table - add a new column as the first column in the table - sql server
Before doing a restore of a database I check how much space I have in each drive on the destination server.
I use this script:
IF OBJECT_ID ('tempdb..#FREE_SPACE_DRIVES','u') IS NOT NULL
BEGIN
DROP ...
0
votes
0
answers
49
views
Extracting a special text from a given text in sql server
I have a text like this :
1XXXXXXXX/ZZZZZMR-A2
.L/TY7R7
.R/DOCS HK1/P/IRQ/A11111111/IRQ/27AUG66/M/25SEP32/XXXXXXXX/ZZZZZ
.R/TKNE HK1 2222222222222/1
1QQQQQQ/WWWWWWMS-B4
.L/TY7HZ
.R/DOCS HK1/P/IRN/...
0
votes
0
answers
66
views
SQL Server - connecting to wrong instance?
So, I've ... inherited a SQL server environment. With LanSweeper, I see this particular server has two instances installed: sql001AK and sql001M5. LanSweeper tells me they have similar databases, ...
0
votes
0
answers
79
views
SQL Server 2016 upgrade
We need to upgrade our SQL Server 2016 to SQL Server 2019. We are also using replication for our test and production environments.
What my question is: what are the downfalls of upgrading from SQL ...
0
votes
0
answers
35
views
Workaround for a view with joined data on encrypted column
I've got a view that currently has this within:
SELECT *
FROM customers_1
LEFT JOIN customers_2
on customers_1.last_four_of_ssn = customers_2.last_four_of_ssn
AND customers_1....
1
vote
1
answer
47
views
Unique constraint for single structure that simulates relations between tables
Imagine I have several tables in SQL Server 2016:
Cat
Cat carrier
Cat transit box
Cat car
Every object can be stored in higher level, but not necessarily directly one above with N-to-1. So a cat can ...
9
votes
1
answer
691
views
Extra NESTED LOOP / INNER JOIN causing NO JOIN PREDICATE warning
I have the following tables in my database.
LastNames Table
CREATE TABLE [dbo].[LastNames](
[LastNameID] [int] IDENTITY(1,1) NOT NULL,
[LastName] [varchar](50) NOT NULL
) ON [PRIMARY]
GO
...
1
vote
1
answer
60
views
Index not being used for date predicate [duplicate]
I'm doing abit of self learning on indexes & performance in a SQL Server. I'm using stackoverflow's database as my sample DB for this activities.
For my testing, I'm using the Users table & ...
0
votes
0
answers
97
views
In SQL Server database mail is not working
Database mail is not working:
Below Error while sending a test mail
Mail not queued. Database Mail is stopped. Use sysmail_start_sp to start Database Mail. (Microsoft SQL Server, Error: 14641)
Checked ...
0
votes
0
answers
24
views
Reduce primary DATAFILE size for an SQL Server Database 2016
In an AG always on configuration (primary) I have a database with 10TB datafile, 50% of the datafile is a free space. Then, I want to reduce this DATAFILE from 10TB to 8TB. How to proceed for that ...
0
votes
1
answer
48
views
snapshot to apply just the schema changes - not the data
I am restoring databases to each side of my transactional and merge replications.
Basically the publication and the subscriber are the same database initially.
I still need to run the snapshot agent ...