336,452 questions
0
votes
0
answers
31
views
sp_addpullsubscription_agent requires Database Master Key but New Subscription Wizard (UI) does not — why? [migrated]
When setting up the pull subscription via T-SQL script, I get an error 15581:
Please create a master key in the database or open the master key in the session before performing this operation. ...
2
votes
1
answer
135
views
Trigger a procedure in my app when database value changes
I want to run a procedure that updates a dashboard (list of tasks) completed.
Users will update the tasks from their apps, which updates a database in the shared server.
This is how far I have come - ...
-1
votes
2
answers
234
views
Why does SQL Date value become NULL when using AddWithValue? [closed]
if (connection.State == ConnectionState.Closed)
{
connection.Open();
string signup = "INSERT INTO TABLE (ID,NAME,SURNAME,MAIL,PASSWORD) VALUES (@ID,@NAME,@SURNAME,@MAIL,@PASSWORD)";
...
Best practices
0
votes
9
replies
139
views
How should I interpret SELECT vs INSERT/UPDATE/DELETE ratios when designing indexes for an OLTP workload?
I'm analyzing a SQL Server 2022 OLTP database and trying to refine my indexing strategy based on actual workload patterns.
The exact schema and queries cannot be shared, but the observed ratios and ...
-2
votes
0
answers
39
views
SQL Server 2016 Patch has broken SQL Server - need traceflag 902 to access server [migrated]
Our platforms team has changed the way in which we install SQL Server patches.
This weekend, a number of patches have been applied on SQL Server 2016 and appear to have broken the servers.
Database '...
0
votes
0
answers
108
views
PDOs parameter binding is avoiding indexes and tanking performance
I have been building a Laravel app and this weeks launch has shown that my database does NOT like how queries are being executed.
When launching my app, our database becomes very slow. Simple queries ...
0
votes
1
answer
132
views
WHERE clause with nvarchar can't distinguish between special characters
I am working with a database that contains some special characters in nvarchar columns. Specifically, it has some text written in special characters, like those font generators create for Twitter or ...
Advice
0
votes
0
replies
78
views
Data type mapping strategy (Migrating Oracle 19c DB into SQL Server 2022 using SSMA)
Do anyone have any good strategy for data type mapping equivalent to be used, specifically for the NUMBER data type from the Oracle source. The default mapping that SSMA uses is FLOAT(53) but as much ...
Advice
0
votes
2
replies
81
views
Using a date parameter to control data volume across DEV/UAT/PROD — is this a recognised pattern?
I've read about environment strategies for data pipelines. The common answers are UAT gets a prod backup restored periodically and DEV gets synthetic data or a manual subset. But nobody addresses how ...
Advice
1
vote
3
replies
128
views
Search SQL Server Database And Return Results Based On A Subset of The Conditions Being Met
I would like to query SQL database and set conditions in the Where clause that return results if a specified number of the conditions are met rather than if all or any of the conditions are met.
For ...
Advice
1
vote
9
replies
180
views
Get Start date of a current partnership
I need to get the start dates of a partnership in different disciplines where the partnership previously existed but the individuals participated with other partners then resumed their partnership. I ...
Best practices
0
votes
3
replies
94
views
Should I use NVARCHAR(MAX) or NVARCHAR(4000) for scarcely filled columns?
Assume we have a really big table in SQL Server with millions of rows. There is a text column that can contain quite long character strings (limited to say 4000 characters of length), but the column ...
0
votes
0
answers
100
views
SQL Server Polybase importing parquet: Operand type clash: bigint is incompatible with datetime
We have a parquet file on S3 and are importing it into SQL Server 2022.
The issue is that mydatetimefield is a timestamp dtype (internally stored as bigint) in parquet file and the dtype on import ...
-1
votes
3
answers
176
views
Select from a table where the column name is a value in the table
I have data from one query that I need to query into a specific format. The data for one of those new columns could be in one of three column in the original data depending on a code. That code is ...
Best practices
0
votes
3
replies
102
views
Difference of count aggregation of two columns
I have a table DepartmentChanges that looks something like this.
EmployeeID
PreviousDept
NewDept
UpdateDate
101
Sales
Marketing
2026-01-14
102
Admin
Sales
2026-02-02
I want to get a query of the net ...