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
0
votes
0answers
4 views

SQL Server Table Partitioning

Looking for documentation about partitioning tables in SQL Server. The last white paper I found was for SQL Server 2008 (12 years old). https://docs.microsoft.com/en-us/previous-versions/sql/sql-...
0
votes
0answers
70 views

Performance of Polybase [closed]

We've been experimenting with Polybase on a SQL Server 2019 (CU2) box and the performance is pretty awful. We've gone as far as scripting every statistic from the remote server onto the external ...
0
votes
2answers
59 views

Tables not showing up when linking SQL Server to Access using ODBC connection

I am learning to link the back end of a database in SQL Server express 2016 to the front end in Access 2016. The tables were originally in Access and then I exported them to SQL Server. Now I am ...
0
votes
1answer
24 views

How is it possible that some people are able to juggle several different SQL variations in their heads at once? [closed]

I have spent the last 20 years dealing with first MySQL (for about 6 years), then 14 years old PostgreSQL. In 2006, I naively thought that it was going to be painless, "because both use SQL"... man, I ...
1
vote
1answer
217 views

SQL Server Agent fails after installing SQL Server 2019 CU2

After installing CU2 our SQL server agent randomly stops working. If you go to check on the status of the agent by opening Job Activity Monitor, it comes up blank for a while then throws an error: ...
1
vote
1answer
23 views

how to list the SSRS permissions in each folder in the reporting services server?

I have the following powershell script that downloads all the RDL from a reporting services server. I am not the author to whom I am very thankful. It has been very useful for downloading the RDLs. ...
3
votes
1answer
97 views

High-resolution CPU usage information for batches and statements

I'm working on a tool that I use to evaluate the performance of SQL Server queries in a development environment. I use, and highly recommend, tools like SentryOne's Plan Explorer, but my tool reports ...
0
votes
0answers
23 views

SQL Server 2019 Performance Regression

We have recently upgraded our DEV environment from MSS 2016 (2012 Compatibility Level) to MSS 2019 (Native). We are seeing performance regressions across almost every query (approx. 12,000). Has ...
1
vote
0answers
23 views

How to prevent Dropping of tables but allow Creating of them, within a Schema

Is it possible to, within a specific Schema, allow a user to create a table, and select from it, but not allow them to Delete or update rows after initial creation, and also prevent them from dropping ...
2
votes
0answers
40 views

SQL Server 2019: InitPersistentVersionStore failed after installing CU2

I have installed SQL Server 2019 CU 2 over a vanilla install of SQL Server 2019 RTM. Now I am puzzled by the following messages in the error log at startup: RecoveryUnit::...
-2
votes
1answer
21 views

insert one table automatically to other table reference column

How to make an insert in one table update a second table? that already insert table...... List item create table table ( id int , student-name var-char(45) ) create table table ( id int , student-...
0
votes
0answers
33 views

SQL Server 2019 Always On performance

We are in process of development of project which will process around 51 000 000 records daily (~around 500-600 inserts per second). We choose Always On solution in SQL Server 2019 which will contain: ...
0
votes
2answers
48 views

Single node availability group - is it possible?

Is it possible to have an availability group with just one node in it? The reason I ask is because I am considering a distributed availability group spanning two single node always on availability ...
8
votes
2answers
16k views

When was a Database taken Offline

I am trying to find a way to figure out when was couple of my sql databases were taken offline. I checked the the logs but could not find any such info and moreover there is no default trace enabled. ...
1
vote
1answer
48 views

Is it better to add a data file or better to increase the existing files (MAXSIZE)

I'm quite familiar with SQL-Server as a developer but not so much in the DBA role. Currently I'm working on a rather large DB (~7TB, living in 7 files, all equal in size and all within one single ...
1
vote
1answer
997 views

SQL Server - How to compress XML inside Trigger?

I am using SQL Server Standard Edition 2012. When doing Audit using Trigger, the fields of the audited row(inserted or deleted) are being inserted into the table in XML Format. However, as observed, ...
4
votes
1answer
2k views

Bringing web service data into SQL server

I need to retrieve a data set daily from a hosted Web service. I can retrieve the XML "column names" in an SSIS package. But I need to retrieve all the data in the data set in csv format or bring ...
0
votes
4answers
93 views

Granting a user a permission to restore a database

In a database I created a user with the following roles: Server Roles public Database roles db_backupoperator db_ddladmin db_datareader db_datawriter The problem is I don't want to change his ...
0
votes
0answers
19 views

Unable to create ssis db catalog

I am trying to create ssis db catalog using wizard but getting this error message: The catalog backup file 'C:\Program Files\Microsoft SQL Server\120\DTS\Binn\SSISDBBackup.bak' could not be ...
2
votes
1answer
106 views

SQL server slow query

I have the following query that is taking a long time to execute (nearly 20 seconds). SELECT Count(*) FROM "workorder" "wo" LEFT JOIN "workorder_fields" "wof" ON "wo"."...
0
votes
1answer
40 views

In SQL server during Log Shippping which portion (active\Inactive) of the Log file (.ldf) backup is taken and further restored in SQL Server

I am confused, like if we take the backup of the whole log file, wont it clear the transaction log though we have copy only backup. In log file we have 2 parts, like active and inactive logs, in ...
1
vote
1answer
32 views

minimum space is required on disk to restore a backup in SQl Server?

Suppose I am going to restore a backup (2 GB) in my sql server, I have sufficient space (20 GB) in my disk, but is there any algorithm that SQL server follows to calculate the minimum disk space ...
5
votes
2answers
814 views

Loop through tables or copy paste

I have to do a migration where I should retrieve data from 40 Access tables, which should contain several of the same columns (but not all, the schemas are different). To make it simpler, I used SSMA ...
12
votes
2answers
8k views

What's the best method to refresh only a few tables within a test database from production?

I have a very large production database and a very large test environment database in SQL Server 2008R2. Both databases have similar table structure but different users/logins/permissions/roles. I ...
0
votes
1answer
86 views

Restarting primary SQL Server instance with log shipping

I have configured log shipping with 20 minutes for backup, copy and restore. If i need to restart my primary server. do I need to stop all jobs (backup, copy and restore)? Please advise. Regards ...
5
votes
2answers
2k views

How can I pass column to function in sql?

I'm calculating median as: DECLARE @TEMP TABLE ( ID INT ) Select ( ( Select Top 1 ID From ( Select Top 50 Percent ID ...
0
votes
1answer
86 views

SQL Server refuses to connect from time to time

I get this error like 5 times a day. It does not happen always and we cannot really reproduce it. So is there any common knowledge as to why SQL Server sometimes refuses to connect and sometimes ...
3
votes
1answer
198 views

Deleting files from within SQL Server

I've been using xp_delete_file to delete old backup files but I now an a need to delete files that are part of an application (as part of GDPR). As xp_delete_file only will only let you delete log or ...
1
vote
1answer
330 views

SSRS 2016 report is failing with 'EXCELOPENXML' render format error

Few reports are failing with 'ExcelOpenXML' render format error after rs migration from 2014 to 2016. I made following change to the RS config file so I can use old excel format however some of the ...
1
vote
3answers
94 views

Remote connection to the instance with window account and NTLM is failing

I have the windows server with 4 SQL server 2012 instances This is the test server. SPNs are not registered for any of those instances. I can successfully connect remotely to 3 of those instances ...
1
vote
4answers
12k views

How to query from a linked server via a linked server in sql server?

I have the following set-up: SQL-Server 1 --linked--> SQL-Server 2 --linked-> SQL-Server 3 The question is can I query SQL Server 3 from SQL Server 1 via SQL Server 2? I have ...
4
votes
4answers
3k views

How to convert varchar iPv4 Address into a number deterministically

What are the various ways to convert a varchar iPv4 Address into a number without using PARSENAME() (non-deterministic) function in SQL Server, in order to create a persisted calculated column? I ...
0
votes
2answers
94 views

Connecting to local database on Azure VM

Using DBforge to try and connect to a local MSSQL database on an Azure Ubuntu 18 VM, I am getting this error: A network-related or instance-specific error occurred while establishing a connection to ...
13
votes
3answers
793 views

Overcome LIKE character length limitation

By reading this LIKE character length limitation here, it looks like I can't send a text longer than ~4000 characters in a LIKE clause. I'm trying to fetch the query plan from query plan cache for a ...
8
votes
2answers
7k views

How do I translate a Windows SID to an SQL Server server_user_sid?

There is this nice SQL Server function SUSER_SNAME which translates a server_user_sid to a user name. This is useful for translating well-known Windows SIDs to (potentially localized) user names. ...
0
votes
1answer
89 views

SQL Server - High buffer time

I'm noticing a high number of waitingRequestsCount on SQL server. The latch_class is buffer. See attached screenshots. Going through SQL server dashboard, I see high number (32221334) waits for Buffer ...
3
votes
1answer
31 views

What happens when there's no tempdb space for version store operations?

If tempdb runs out of space, do transactions that need version store space fail, or do they wait for space to be freed?
14
votes
2answers
740 views

Computed Column Index Not Used

I want to have a fast lookup based on if two columns are equal. I tried to use a computed column with an index, but SQL Server doesn't seem to use it. If I just use a statically populated bit column ...
4
votes
0answers
42 views

how to remove all permissions in a database?

every time I need to either restore a database or reinitialize a replication publication I first (on the restored to be or subscription database) I script all the permissions, triggers, indexes, ...
3
votes
1answer
96 views

sp_Blitz fails with collation error

SQL Server version (output from select @@VERSION): Microsoft SQL Server 2017 (RTM-CU19) (KB4535007) - 14.0.3281.6 (X64) (Build 14393: ) Installed sp_Blitz from Brent Ozar, stored procedure creates ...
2
votes
1answer
209 views

Identity management in Transaction replication with updatable subscription

I have migrated my publisher DB to new server yesterday. For migration what I did was removed subscriptions and publication completely backed up DB on which publication was configured restored DB to ...
0
votes
1answer
22 views

Convert a numeric column with number eg.(-1222222) to two float column with two decimal places eg (-12222.22)

I know there are different variations of this question asked. But what I am trying to do is that, there is a table with a numeric column (12,0) that has data looking like Units ----- -1222222 0 -19 ...
0
votes
1answer
223 views

how to install mssql on to ubuntu

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1' : file not found. pugazhl@pugazhl-LIFEBOOK-LH532:~$ # sqlcmd -S ...
2
votes
1answer
35 views

what does I/O affinity automatically do when cpu affinity is manually set

I have a 2016 Enterprise db server with 4 processors and 24 cores which is CAL licensed. So only the first 20 cores are used. Now I would like to set affinity so SQL Server will not use the first 20 ...
0
votes
0answers
17 views

Alter Filegroups to move from alternative FG back to Primary

I have a multitude of SQL Db's that have in excess of 80 individual file groups - I have been tasked with a project to try and get those FG's moved back to the primary - so I'd essentially have to ...
2
votes
1answer
71 views

How to display rows containing special characters in a certain column

I have a table with the column f_Name. The column f_name sometimes contains special characters and numbers as in the examples below: f_name ----------- Pan23's Ram'kumar lawer"s() I want to ...
0
votes
0answers
23 views

sql server failover cluster setup [closed]

Someone use or know a tool to automate an Sql Server Failover cluster with multiple nodes? We are try now with CHEF but it no provide this kind of setup. Do we have found a possible workaround but we ...
0
votes
0answers
22 views

Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, page server reads 0 [duplicate]

When I turn on the STATISTICS IO in SQL Server the provided message include the following: Table 'Customers'. Scan count 9, logical reads 19500, physical reads 0, page server reads 0, read-ahead ...
0
votes
1answer
51 views

Understanding about Execution plan and Index in SQL Server

I’m Christine and I have been studying for Data Analytics, I would like to know if you could help me clarify what I'm drilling down this execution plan as below. About detail of execution plan, you ...
0
votes
1answer
26 views

HIVE SQL [Error 10025]: Expression not in GROUP BY key

Here is my SQL statement: my_table includes 10+ columns (e.g, day, ip_address, user, request, etc), including strings and numbers. I want to GROUP by & HAVING based on column 'ip_address', if ...

1 2 3 4 5 548