Questions tagged [sql-server]

All versions of Microsoft SQL Server (not MySQL). Please also add a version-specific tag, like sql-server-2016, since it is often relevant to the question.

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

Cannot deploy SSIS packages after upgrade to SQL Server 2016 SP2 Build 5201.2

We recently upgraded from SQL 2016 SP1 build 4466 to SP2 build 5201 (CU2 GDR) on an AG. On one server an analyst was deploying SSIS using Visual Studio Enterprise 2015 (version 14.0.25431.01 Update 3 ...
-1
votes
0answers
24 views

SQL Server Error 945: database cannot be opened due to inaccessible files or insufficient memory or disk space

Machine: 2 Core 4 Gb RAM Edition: SQL Server 2017 Express Edition Error: Error 945: database cannot be opened due to inaccessible files or insufficient memory or disk space Disk Space: 45 GB Free ...
0
votes
2answers
27 views

procedure not returning desired result

I am trying to generate a report from this procedure create procedure [dbo].[hstatement] ( @fromdate date, @todate date, @prd varchar(8) ) as begin create table #tempdata ( ...
0
votes
2answers
108 views

ISO 27001 - resetting passwords for SQL Server accounts

We are implementing security changes in order to pass an ISO 27001 audit. We are in the process of setting all domain accounts (user accounts, admin accounts, service accounts) to have their passwords ...
0
votes
0answers
9 views

MSSQL Logon Error in /var/opt/mssql/log/errorlog

Hello I checked in /var/opt/mssql/log/errorlog. then I get an error message like this: The login packet used to open the connection is structurally invalid; the connection has bee 2021-01-22 16: 47: ...
49
votes
5answers
97k views

Does SQL Server CASE statement evaluate all conditions or exit on first TRUE condition?

Does the SQL Server (2008 or 2012, specifically) CASE statement evaluate all the WHEN conditions or does it exit once it finds a WHEN clause that evaluates to true? If it does go through the entire ...
6
votes
7answers
12k views

How to run sql agent jobs in a sequence order.with T-sql

My requirement is to run the SQL Agent jobs (EX: job1 to job10) with T-sql in a sequence order. That means job2 starts automatically when job1 completes. This process should continue until job10 ...
1
vote
1answer
16 views

What is VPS\example.com_web identity in SQL server?

I was facing connection failed for requested login in SQL server 2016 used for example.com domain on a VPS. I added the following logins to the database NT AUTHORITY\IUSR and NT AUTHORITY\NETWORK ...
1
vote
2answers
44 views

Query Cost when filtering with varchar vs nvarchar

Recently the application I'm working on encountered performance issue on a particular table. When I check the queries executing on this table, I noticed a warning about CONVERT_IMPLICIT on the ...
2
votes
1answer
55 views

cube and one example

if a data presented with 4-dimension in which each dimension is dependent to hierarchical 3-level aggregate like (country, city, street), then we can summarize it into 4096 ways ! we know for cube ...
0
votes
2answers
45 views

The media family on device incorrectly formed for read only file group restore

Yes the databases (source and destination) are the same version. I have checked 3 times. Both are "Microsoft SQL Server 2019 (RTM-CU8-GDR) (KB4583459) - 15.0.4083.2 (X64)" The database ...
4
votes
4answers
18k views

STRING_SPLIT and ordered results

Can you assume that the result of the string_split function returns elements in order? In short, is the following code correct? DECLARE @tags NVARCHAR(400) = 'clothing,road,touring,bike' DECLARE @...
0
votes
1answer
421 views

Replications fails with a vague message: “The last step to run was step 3: Detect nonlogged agent shutdown”

In Transactional Replication of SQL Server, Synchronization job starts well and proceeds a while. However, in middle of the work it shows this error: The job failed. The Job was invoked by User WIN-...
0
votes
1answer
33 views

MSSQL - Insert Into adding data into the middle of the table? [duplicate]

A bit of a random one here... I've got a basic table that I'm using for temporary data inserts - and for that reason, I don't need or want a unique ID - however, I'm seeing odd behaviour! (or it feels ...
1
vote
2answers
176 views

How to improve query performance?

I have a query that executes very often on our system and there is no option to change the query text. Are there any suggestions on what could be done? Any help would be appreciated. The query: ...
-3
votes
0answers
38 views

using the “WITH … AS” function, how can I declare a variable? [closed]

I am trying to declare a date variable which will be reused a few times within the WITH... AS procedure: DECLARE @DATA AS DATETIME SELECT @DATA = 202101 WITH TRANSACTIONS AS(...
2
votes
2answers
798 views

Clustering SSAS

We are using both SQL Server 2012 and 2014 always on. Here is my issue: we have an application that I have set up to use Availability groups(2014), however the issue I am having is that it uses ...
1
vote
0answers
26 views

Linked Server to Hana DB

I am trying to create a linked server connection from sql-server to Hana DB. I have downloaded the Hana client and all the drivers along with it. I have tried creating a system DSN and then adding the ...
2
votes
3answers
252 views

Will SQL Server go offline if it loses network connectivity to SAN where master and msdb system databases reside?

I have a setup where 3 servers combined into Availability Group All 3 servers have local directly attached SSD drives, and user database files are hosted on these drives But the system databases (...
0
votes
1answer
34 views

DB autogrowth issue

I have a database that will growth in 1 month time the autogrowth was set to 500MB but as I monitored it, the consumption is 1GB+ per day. Should I wait for it to auto grow or is it better to set the ...
0
votes
3answers
70 views

Maximize production of log records

I need to fill in transactional log file in possibly shortest amount of time. I have tried a few variants of a loop of inserts and deletes on the same record. I fired it on separate tables in several ...
2
votes
2answers
211 views

Linked Server throws metadata error

I have a function in SQL Server 2019 that copies data from a local table to an Oracle 11.2.0.4 table via Linked Server, using Oracle 19.3 client. Recently, a new column was added to the Oracle table, ...
0
votes
0answers
10 views

AWS S3 IA as a filesystem for SQL Server VM

I want to archive billions of rows from a PROD db to a cheaper storage layer such as Amazon S3 Standard-Infrequent Access. I came up with the idea of just mounting the storage as a new volume and ...
-3
votes
1answer
34 views

while loop in sqlserver

my query is as below @tdate as date='01-dec-2020' while @tdate<'01-jan-2021' begin --logic select * from ( select LBrCode,substring(PrdAcctId,1,8)+'000000000000000000000000' PrdAcctId,dt --...
-1
votes
2answers
57 views

Purpose to use timestamp datatype in sql server? [closed]

What is the purpose to use timestamp datatype in sql server? Do you have a concrete example of using timestamp in real business case? When is it relevant to use timestampe datatype? Thank you!
0
votes
1answer
23 views

One-directional database replication without delete on target database?

I have two databases: A small one where data is permanently added and a big one where the data is copied from the small one and is supposed to be stored long term. The small database deletes old data ...
0
votes
2answers
39 views

SQL INSERT INTO SELECT query for updating on same table with some modification

I want to update this table Table name: Student Name Department Alex CSE Bob EEE Briyan ME by copying all rows with some modification like this table: Table name: ...
0
votes
1answer
15 views

SSIS cannot deploy package to SQL server - An error occurred during decryption 15466

After recovering and re-importing a backup of a SQL Server 2019 instance none of my SSIS packages will deploy from Visual Studio. Whenever I try and deploy I get the error =============================...
0
votes
1answer
29 views

How to create a mapping table?

I have 2 tables as below CITY_A ID CODE CITY 001 90 PARIS 002 90 PARIS 003 85 PARIS 004 60 SYDNEY 005 75 SYDNEY 006 75 SYDNEY CITY_B ID CODE CITY 001 IN PA 002 OUT PA 003 OUT PA 004 IN ...
4
votes
3answers
259 views

General Question on sp_recompile

For couple of scenarios, not many a times but few we have seen doing sp_recompile on a stored proc improving the performance. Being a DBA i understand few of caveats involved when doing sp_recompile ...
1
vote
3answers
6k views

Can't deploy SSAS Tabular Model in Visual Studio

I am following the SSAS Tabular Model Tutorial by Microsoft using the Adventure Works DW. I've imported the DW in SQL Server Management Studio to my local server. I've connected to the DW from Visual ...
1
vote
1answer
58 views

Why does the log file grow larger than data file for an availability group database on the secondary replica?

I've got a SQL Server 2016 AG set up with only two replicas (primary and secondary). Both synchronous, non-readable secondary, and backup the primary only. Transaction Log backups occur on the primary ...
3
votes
1answer
100 views

MSSQL Server XE column client_connection_id accessible through system view/table for auditing?

In our .NET application we create a SqlConnection to talk to the database. After the connection is opened, we get the ClientConnectionId, a GUID. Within the extended events I can manage to trace the ...
4
votes
4answers
4k views

patching SQL Server with Availability Group and Secondary Replica

Scenario: SQL Server 2014 CU6. 1 AG with 2 databases (compatibility level 100). Failover Cluster with 3 nodes on Windows Server 2012 R2. Primary Availability Replica on node 1 and node 2. Secondary ...
3
votes
0answers
80 views

Time to generate execution plan for select into from a view takes significantly more time than select

I have a view, vw_example, that is quite complicated and has multiple joins across multiple databases. This view has been causing significant delays when used as part of other queries, and we've ...
0
votes
1answer
41 views

upgrading SQL Server 2017 Standard to 2019 Enterprise [closed]

We are about to upgrade our SQL Servers from 2017 standard to 2019 enterprise. Does anyone have any real world experience on the best way to do this? We do not use HA, so our one prod server needs ...
1
vote
0answers
24 views

Every other SQL Server deployment fails due to access denied on Kubernetes [migrated]

I am deploying a SQL Server 2019 to Kubernetes with the following manifest: apiVersion : apps/v1 kind: Deployment metadata: name: sql spec: selector: matchLabels: app: 'sql' template: ...
0
votes
1answer
39 views

Reasons For Slowness in SQL Server 2008 R2 Express Edition [closed]

We are observing intermittent slowness in our SQL Server. We ran sp_who2, sp_who3 stored procedures for checking CPU/IO usage but did not see any spikes/abnormal values. What else could be the ...
5
votes
0answers
104 views

SQL Server 2019 service terminated unexpectedly at startup but manually starts

I've had a SQL Server 2019 server working great for the past few months, but it started stopping by itself since last Friday. This morning, I installed latest cumulative update on it. Here is my ...
0
votes
1answer
29 views

Importing files with a mix of decimal separators

Using SQL Server Management Studio 18.3 I want to import data (semicolon separated text file) that has some columns with dot as decimal separator, and some with comma as decimal separator. I can't ...
1
vote
1answer
96 views

Configure Login Audit - Skip one user-

I have configured the login audit to save only the failed ones, but I need to omit a specific login in said audit, is it possible? I am using sqlserver 2008-r2 Thanks.
0
votes
1answer
911 views

Cannot drop the user because it does not exist or you do not have permission

I am getting this message for some users when executing sp_revokedbaccess procedure for database users. Users I am trying to remove are selected from sys.database_principals with type = S, W or G (sql ...
0
votes
0answers
110 views

Parallel execution of a SQL Server external script

TLDR for a reader with the same problem If your external script is too slow, you may do something in your scritpt which can be implemented in TSQL, which is a big problem. If this is not the case use ...
2
votes
1answer
262 views

SSRS ReportServer_XXX.log is giving incorrect CPU count

I am currently investigating an issue wherein sometimes the SSRS just suddenly stops accepting requests until we do an IISRESET command. This happens after we added an additional processor on the ...
0
votes
1answer
41 views

SSMSBoost intellisense not working? [duplicate]

SSMS Version 17.9.1 It looks like the intellisense may not be working? Shouldn't it auto complete Select etc? Also, it looks like the intellisense is from SSMS itself (doesn't work that great) I've ...
3
votes
2answers
2k views

Understanding Variations on Multiple Joins

I have two versions of a multiple join which produce identical results. The five tables are: customers ← sales ← saleitems → paintings → artists The arrows (hopefully) show the relationship between ...
0
votes
3answers
52 views

NOT EXISTS with two subquery fields that match 2 fields in main query

Background: Two different document types in a document management system. Both Doc Type A and Doc Type B have a Ticket #, and a Ticket Date. What we're looking for: Doc Type A docs that don't have a ...
0
votes
1answer
38 views

ReFS vs NTFS - which is better for SQL Server 2019 on Windows Server 2019

We want to install SQL Server 2019 on Windows Server 2019; currently Admin has formatted Nimble Storage with ReFS. Is it really better than NFTS? I have seen other posts wherein people have mentioned ...
-1
votes
0answers
44 views

SQL Querey Help

This querey was written, and I have to make it show the InvoiceFee.FeeAmount field. Currently, it does not show. It only populates Invoice.InvoiceDate, Invoice.InvoiceNumber, Customer.Name, and ...
13
votes
3answers
30k views

Master database is corrupt, instance won't start - what are my options?

Help! My master database is corrupt, I can't even bring the SQL instance online! What are my options to get my server back up? I do have a backup of master, but the MSDN page "Restoring the master ...

1
2 3 4 5
588