336,626 questions
0
votes
1
answer
119
views
INSERT unique incremented number from SELECT on the same table by several users without creating duplicates
I have a requirement to generate unique incrementing serial numbers by product type from a VB.NET application using SQL Server Express.
I have created a table and also have a VB form where I am ...
Best practices
0
votes
2
replies
23
views
Shrink SQL Server database
I have a SQL Server database with 700gb, approximately 300gb to shrink after we did a table sanitization. The database is not going to get to that size again, so I have to shrink it, but my problem is ...
-3
votes
0
answers
82
views
Float value changes when rounded [duplicate]
Found myself with this awkward situation:
As you can see, the value of field "amount" (float) is shown, when not converted/casted, as "10000".
When I cast it to int, it becomes ...
Best practices
1
vote
7
replies
97
views
Why is PostgreSQL COPY significantly slower than SQL Server BULK INSERT?
I’m trying to understand why PostgreSQL COPY is much slower than SQL Server BULK INSERT in my scenario (or every scenario?).
I have 30 .CSV files that are loaded into 6 different tables.
In SQL Server,...
Best practices
0
votes
10
replies
88
views
Any advice on Inner Join query performance
I have a T-SQL query shown here which is taking forever to run.
I am trying to see if there is a better way to write the Inner Join statement. The source table has a millions of rows.
Is there any ...
0
votes
0
answers
109
views
How to get the SQL for an ancient view when none of the usual methods work
I need to get the SQL definition of a view. Problem is, it was created many decades and SQL Server versions ago using whatever GUI was available then, not via a CREATE VIEW statement. Another problem ...
0
votes
0
answers
43
views
How to prevent SSDT/DACPAC publish with DropObjectsNotInSource=True from dropping Azure Functions az_func runtime tables
I’m deploying a SQL Server/Azure SQL database using an SSDT .sqlproj (DACPAC) and SqlPackage.exe (DacFx publish). For local dev we require DropObjectsNotInSource=True so schema drift/renames are ...
Advice
0
votes
5
replies
58
views
Modifying an Access VBA project with VBA
In principle I should be able to write some VBA code, and run it over a VBA project to amend the project.
Scenario: A collection of databases is being moved from one server to another.
There are a lot ...
0
votes
0
answers
35
views
When using isql via ODBC Driver 17 or 18 in Linux, how to login using Windows Account to SQL Server
Using SQL Server authentication and Windows authentication, I can login to SQL Server (via SSMS).
When using isql via ODBC Driver 17 or 18 in Linux, how to login using Windows account to SQL Server?
...
1
vote
2
answers
141
views
SQL column from different tables to array
I have multiple functions to convert column values into an array
CREATE FUNCTION FN_ToArray
(
@separator NVARCHAR(10) = '|'
)
RETURNS NVARCHAR(500)
AS
BEGIN
DECLARE @return VARCHAR(500)
SET ...
-4
votes
0
answers
78
views
SQL Server Error 1204 every 13-15 minutes [closed]
I’m seeing Error 1204 severity 19 state 4 every 13 to 15 minutes all day with different system spids.
Error Desc: "the SQL Server Database Engine cannot obtain a lock resource because it has run ...
0
votes
2
answers
104
views
Incorrect ordering in CTE query
I run the below query against a view in MS Fabric environment (Data Warehouse). Here the compl_officer_id is the same across management_id partition (unfortunately there are no other unique values ...
1
vote
1
answer
118
views
LINQ to SQL mapping a SQL Server uniqueidentifier to a Guid [closed]
I am trying to access a SQL Server uniqueidentifier using Linq-to-SQL mapping:
Table -
CREATE TABLE [dbo].[Members](
[guid] [uniqueidentifier] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
...
0
votes
0
answers
52
views
SSIS Package Configuration with OData
I am attempting to use package configuration for an SSIS package that uses an OData Connection manager.
I am using SSIS 2019 and Visual Studio 2022 running on Windows 10.
I am running the following ...
0
votes
2
answers
120
views
Join two table with column values based on condition being met [closed]
I am trying to flatten out two different tables for a report(view) but I am having a hard time. One table is tbRecord which contains a unique master record id and a sub table tbInspectedPart that ...