Questions tagged [sql-server]
Microsoft SQL Server is a relational database management system (RDBMS). Use this tag for all Microsoft SQL Server editions including Compact, Express, Azure, Fast-track, APS (formerly PDW) and Azure SQL DW. Do not use this tag for other types of DBMS (MySQL, PostgreSQL, Oracle, etc.). Do not use this tag for issues on software and mobile development, unless it is directly related to the database.
sql-server
335,442
questions
1
vote
0
answers
12
views
Ordinal enum mapping with hibernate 6.5
I'm upgrading hibernate from 6.1.7 to 6.5.2, there are many enum columns in my entities marked with
@Enumerated(EnumType.ORDINAL). My codebase has to run against both oracle and sqlserver.
The problem ...
0
votes
0
answers
11
views
Executing Procedure in SSIS Visual Studio with Result Sets
I am running one of the scripts which uses procedure to fetch some columns. Data Keeps Changing sometimes there are Location_code columns are 1,2 and 3 sometimes 4.
emp_id
Home_location
Location_1
...
0
votes
1
answer
31
views
SQL Server applying ORDER BY .. OFFSET only to UNION subquery
In SQL Server 2022 (and earlier), this behaves as I'd expect, according to the SQL standard:
select i
from (values (1)) as t (i)
union
select i
from (values (2), (3)) as t (i)
order by i
offset 0 ...
0
votes
1
answer
21
views
Laravel migrations create table column with dot in colum name
I have a table in SQL Server database where a column has a dot in its name. When I first created manually the table I had no problems doing it, but now that I'm changing the db server I decided to ...
0
votes
1
answer
22
views
SQL Server XML column is string in .NET using SqlDataReader
Why if in SQL Server, I have a column defined as XML type, and in .NET with SqlDataReader/SqlDataAdapter I have a string?
See the example in the screenhsot, cast c1 in XML, but .NET gets a string.
I ...
-5
votes
0
answers
27
views
hi Where is the error in this query? someone can help me? [closed]
SELECT view_fav_items.* ,1 AS fav FROM view_fav_items
INNER JOIN fav ON fav.fav_itmesid = view_fav_items.items_id AND fav.fav_userid = 17
UNION ALL
SELECT * , 0 AS fav FROM view_fav_items
WHERE ...
0
votes
0
answers
15
views
How do upload images to Jfrog with layers larger than 2GB when using an external database
We are currently encountering issues with our JFrog Installation. Our JFrog is running in Kubernetes, and initially, we had it running with regular PVCs and no problems. However, when we attempted to ...
-3
votes
1
answer
54
views
SQL group by month with conditions [duplicate]
I'm trying to get event count from the SQL Server database grouped by months but with a few conditions. I can't build a query that makes the result I'm hoping to get.
I want to get current year's ...
-1
votes
1
answer
48
views
Get data with budget and act [closed]
I have a SQL Server table:
CREATE TABLE your_table
(
ER VARCHAR(512),
MONTH VARCHAR(512),
SCENARIO_CD VARCHAR(512)
);
Sample data:
INSERT INTO your_table (ER, MONTH, SCENARIO_CD)
...
0
votes
1
answer
46
views
Prevent Insert in stored procedure from being rolled back by caller
I created a stored procedure with an insert like this:
CREATE PROCEDURE MyProcedure
@Param1 varchar(50)
@Param2 varchar(50)
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO MyTable
@...
-3
votes
0
answers
35
views
Connect to SQL using windows credentials
I'm trying to connect to Azure SQL using Active Directory Account.
I am able to connect using the SSMS when I run as a different user but programmatically it fails.
Tried multiple connection strings ...
-1
votes
0
answers
32
views
SqlServerBulkCopy Java API to load records in bulk to SQL Server target using resultset approach [closed]
We are trying to load data in bulk to SQL Server target through sqlserverbulkcopy Java API. This is the link to documentation https://learn.microsoft.com/en-us/sql/connect/jdbc/using-bulk-copy-with-...
-1
votes
0
answers
47
views
Understanding performance lag on a simple CTE
I am trying to calculate the carryover of PTO hours from one year to the next. In order to do this, I need to know the previous year's "remaining balance", which requires knowing the ...
0
votes
0
answers
24
views
Create a user on AWS SQL Server Read replica
As far as I know, AWS RDS does not sync the user creation on replica database. I created a user on the main database. However, the user has not been synced on the replica. I tried to create the user ...
-1
votes
1
answer
42
views
T-SQL query to get computer name that has not made a query to database in 60 days
I have a table Queries that keeps track of every query made to a database with a date_time stamp and the computer name.
There can be 1000s of rows for the same computer, each one with a different ...