44 questions from the last 30 days
Advice
2
votes
8
replies
118
views
Android driver app location sending to server (Taxi booking app)
I developed a simple Android app (A driver app for taxi booking).
App sends its location (lat/lng) every 5 seconds to server using TCP/IP. and server stores the driver location in SQL SEVER database. ...
-4
votes
1
answer
176
views
Recursive CTE looking for all combinations of values that equal one target amount
I found examples online using a recursive CTE to find all combinations of values that equal one target amount. The database column ledger_amount is DECIMAL(26,6).
DECLARE @TARGET_AMOUNT DECIMAL(26, 6) ...
Advice
0
votes
3
replies
64
views
Procedure to show percentage of nulls in TERADATA SQL ASSISTANT
I'm working in Teradata SQL Assistant and I need to create a stored procedure that, given a table name, returns the percentage of NULL values for each column in that table.
Right now, I generate the ...
Advice
1
vote
12
replies
154
views
Advice for archiving SQL Server data of a selected date range into a text file
We have some tables in an on-premises SQL Server database that we archive data every day.
Currently, we have a schedule task that runs a C# program, that write old data into a .CSV file. Each batch ...
0
votes
1
answer
107
views
Aggregate function for bit-wise OR [duplicate]
In SQL Server 2022, is there an aggregate function for doing a bit-wise OR against a particular column?
-- Example table, data and output to show the different flags
DECLARE @TEST TABLE (FLAGS TINYINT)...
2
votes
2
answers
186
views
Join on one column and if null join another column
I need some help handling null columns in joins. I have three tables (below are just examples) Map, Employee and Region. Primary table is Map where I join Employee table on the MapID column to get ...
2
votes
3
answers
136
views
Correctly escape a trailing backslash in a string within XML to JSON function?
I have created a recursive SQL Server scalar-valued function that converts XML data to a JSON string. The function works well for most cases, including nested elements and handling of arrays (using a ...
0
votes
1
answer
135
views
How do I create connection string with App Registration/Service Principal for a Web API using EF Core app with SQL Server using Microsoft Entra MFA
I have a generic ASP.NET Core Web API that uses EF Core to connect to a SQL Server instance that uses Microsoft Entra MFA account.
The connectivity prompt for the SQL Server looks like this:
I have ...
-1
votes
0
answers
160
views
Inserting rows into table with geometry column creating awful execution plan [closed]
I am seeding a database by copying over data from another database on the same server. In one of the tables, I am doing an INSERT INTO SELECT statement to bring over a few columns. While existing and ...
0
votes
1
answer
126
views
Compare the results of Boolean expressions
Is there any way to compare the results of Boolean expressions as in the following query? This expression gives the error Incorrect syntax near '='. at the first '='.
select *
from Transfers
where (...
0
votes
1
answer
107
views
Combine multiple selects and write to 1 row in a temp table
I have a stored procedure in Microsoft SQL Server. I want to combine multiple results into 1 row like this:
ID
Period
Income
202501_a
202501
50528.55
NOT LIKE THIS
ID
Period
Income
202501_a
NULL
NULL
...
1
vote
3
answers
78
views
How to group the data to avoid multiple rows
I have an employee Manager table where you can see for every deptID, there are multiple rows.
A few rows have null employeename and a few rows have null managername for same DeptID. i would like to ...
-3
votes
0
answers
70
views
How to automate the daily import of TXT files into SQL Server? [closed]
In the company where I work we receive daily TXT files exported from SAP via batch jobs. Until now I’ve been transforming and loading some files into SQL Server manually using Python scripts, but I’d ...
-1
votes
0
answers
101
views
How to enable full-text search feature in SQL Server on .NET Aspire?
How to enable full-text search feature in SQL Server for .NET Aspire?
var sqlServer = builder.AddSqlServer("sqlServer", builder.AddParameter("password123!!!", true))
.WithLifetime(...
Advice
0
votes
2
replies
83
views
Process improvements, A company wants to incorporate AI but the current process hadn't change in 25 years
Goal
The company wants to grow and take advantage of the AI revolution. But there is no roadmap and the current process limits their growth capability. The current process is about 20% automation and ...
-8
votes
1
answer
123
views
Find total minutes [duplicate]
Note that it's saved in time datatype.
So if I have someone that started work at let's say 5:30 am and ended their shift at 10:00 am
Is there faster way than:
declare @Shiftstart time;
declare @...
1
vote
2
answers
109
views
Clustered columnstore index with computed column -- why does segment elimination not work?
Recent versions of Microsoft SQL Server allow creating a clustered columnstore index on a table that has computed columns, as long as they are not persisted computed columns. [1]
I would like to get ...
-3
votes
1
answer
51
views
Connecting SQL Server to Cypress
I am trying to connect the DB for testing web elements that have dependencies on data, and in general to add some reliable BE testing.
Currently I have cypress.config.js:
// cypress.config.js
const { ...
-1
votes
1
answer
61
views
Publish VS project fails on System.Net.Http 4.2.0.0 not found in SQL Server even though other projects use it
I have several Visual Studio projects (Stored Procedures) that have been published to SQL Server 2014 (yes old I know - legacy software) that use System.Net.Http v4.2.0.0 so I know that the assembly ...
0
votes
0
answers
47
views
Best practice for backing up large SQL Server databases to S3 [closed]
We are currently backing up all of our databases to a series S3-Compatibable storageGRID buckets hosted by our data center provider. Some of our larger databases backups run quite long (upwards of 8 ...
-2
votes
0
answers
42
views
Intermittent Database Connection Issues when using SSMS [closed]
I'm having intermittent connectivity problems when trying to connect to an azure based SQL database when using SSMS. I've done the following troubleshooting:
The exact same version of SSMS has been ...
0
votes
0
answers
24
views
SQL Server 2019 (v15) : tempdb related files eat up about 80 GB on C disk, how to make it small and free up some space in C [migrated]
On Windows Server 2016 and with SQL Server 2019 (v15.0), the tempdb file size is huge at about 80GB and it is divided into many files such as:
tempdb.mdf,
tempdb_mssql_2.ndf
tempdb_mssql_3.ndf
...
...