All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Postgres Java heap space error while selecting on a very small table [on hold]

I have a very small table - below 4,000 rows, and 45 columns. When running a regular select, the table returns after a while - about 30 seconds. When adding a condition to the select, for example, ...
1
vote
0answers
8 views

How to “update” change_tracking setting to enable TRACK_COLUMNS_UPDATED

I have a table where I have enabled change tracking without TRACK_COLUMNS_UPDATED. I know this because if I go through SSMS's Generate scripts, I get the line: ALTER TABLE [dbo].[dt] ENABLE ...
0
votes
0answers
18 views

Csharp , Dotnet [migrated]

How I do delete the file and folder in "C:\Users\soft\Recent"? When I tried this line string path="C:\Users\softw\Recent"; foreach (var folder in Directory.GetDirectories(path)) Directory.Delete(...
0
votes
1answer
17 views

Preventing query to stay in pool

How can I prevent my finished queries to stay in pool? Below is the image of my database and a lot of my finished queries are staying and I want them to be removed but don't know how. This is my ...
0
votes
1answer
20 views

how to create Anonymous function and how to call Anonymous in postgres? [on hold]

Please Any one help the steps of create Anonymous function and how to call Anonymous functions in postgres. Thanks
-1
votes
1answer
26 views

insert a variable and table value as parameters to procedure [on hold]

CREATE PROCEDURE [dbo].[GetFruitName] ( @quantity int ) AS BEGIN SET NOCOUNT ON; INSERT INTO Table1(fname,fprice,quantity) SELECT f.name,f.price from ...
0
votes
1answer
31 views

Memory Settings for SQL Server, SSAS, and SSRS

I started a new job about 4 months back and was surprised to learn that there has NEVER been a SQL Server DBA here, just developers who don't really know what they're doing (like me). I am not a DBA ...
0
votes
2answers
20 views

Query returns repeating arrows when getting sum of a column grouped by some others columns

I have table Inventory and I want to get the sum(quantity) grouped by the columns gid, version, warehouse +----------+----------+-----------+----------+--------------+ | gid | version | ...
0
votes
1answer
23 views

Disaster Recovery through cloning drives in sql server 2014 enterprise

I am a DBA noob and recently my work has considered to have a disaster recovery plan for their production DB lets say A (sql server 2014 enterprise). The production server A and Disaster recovery ...
0
votes
0answers
18 views

postgresql pg_dump out of memory

it is possible to limit somehow usage of resources for pg_dump? The problem is, whole DBase is 775GB: Pg_largeobject table is 390GB other one table weights – 265GB. i give to PGSQL 20gb of RAMs ...
0
votes
1answer
20 views

how do i get rows for each month which contain the store with the highest number of purchases?

how do i get rows for each month which contain the store with the highest number of purchases? my code is: SELECT DATE_FORMAT(buyDate, '%M') as month, count(id) as numPurchases, store from ...
0
votes
0answers
14 views

Is it safe to leave/exit the stored procedure without commit or rollback on a transaction?

Like the code below is it safe to do that? create definer=`root`@`%` procedure `test`() label: begin declare exit handler for sqlexception rollback; start transaction; select condition from table ...
0
votes
1answer
16 views

About Apex SQL Refactor and SSMS keyboard shortcuts being broken [on hold]

Hi DBA Stack Exchange! Today I tried Apex SQL Refactor and right from the get go, once installed and integrated into my T-SQL dev tool of Choice (SSMS 18.3.1) I noticed that some Keyboard shortcuts ...
2
votes
0answers
10 views

How do I use mariabackup to do point in time restores?

So I've read about the basic way that I can backup my mariadb using mariadb backup... What I don't understand is how to make it point in time...... So I want to restore using mariadbackup full and ...
0
votes
1answer
14 views

When might a tsvector field pay for itself?

I've been experimenting with tsvector indexes for Full Text Search, and see that it's a common practice to generate an store a vector in a column of type tsvector. We're on Postgres 11.4, but I've ...
0
votes
0answers
12 views

prepared statement returns NULL, unable to retrieve the column value

I'm creating a procedure where it will iterate over every column in a table and get maximum value of every column. This is my code: DELIMITER // DROP PROCEDURE IF EXISTS min_max // CREATE PROCEDURE ...
0
votes
0answers
15 views

Creating a custom thesaurus dictionary on RDS

We're deployed on RDS using Postgres 11.4, and I'm hoping that there is some way to define a custom thesaurus dictionary. I think the answer is a hard no, based on this StackOverflow thread and this ...
0
votes
1answer
20 views

Moving columns based in last analyzed date

I have to create a report to summarize some metric results over the last 12 months by account, each time a metric is processed is added to the account attainment with the last 12 months results. The ...
1
vote
2answers
27 views

How to get the oldest values over each id in a PostgreSQL table efficiently?

How can PostgreSQL return a list of the oldest timestamp values over a table of sensor id measurements? Let me explain the situation with a sample table: CREATE TABLE sensor_data( sensor_id INTEGER, ...
0
votes
0answers
11 views

Postgresql 10: Ldap authentication failing

I configured the pg_hba.conf of Postgresql 10 with following host Tom Tom XXX.XX.XXX.XX/32 ldap ldapserver=XX.XX.XXX.XX ldap ldapbasedn="ou=People,dc=example,dc=com" ldapbinddn="cn=Tom,ou=People,...
1
vote
0answers
39 views

Tempdb. There is no enough space on the disc encountered

Does anyone know what really happened here? All of the sudden database was not accessible. How to find transactions that cause tempdb filled up? Seems like it happened right after SQL profiler ...
1
vote
3answers
79 views

Filtered index is not used when variable in WHERE condition

Why MS SQL Server refuse using supporting filtered index in this scenario? -- demo data CREATE TABLE #Test ( ID INT IDENTITY(1,1) NOT NULL CONSTRAINT PK_Test_ID PRIMARY KEY ,Col1 NVARCHAR(36) ...
0
votes
0answers
38 views

Executing a stored procedure inside another stored procedure from a linked server

I'm having a problem and I don't know how to solve it, I have searched the web and found good advice but I can't work it out. This is the problem: I have a SQL Server instance running on my PC, and I ...
-1
votes
0answers
8 views

sql workbench 8.0 error

I need to open table that:represents what owner adopted what animal (the relations is one to many) ● Primary Key is the combination of both ​owner_id​ and ​pet_id ● owner_id​ references ​id ​from ...
3
votes
0answers
10 views

How to identify writeable/partitioned views?

Assuming all the necessary prerequisite requirements are met, Sql Server will make partitioned views writable. How can I identify what views are in this state? A followup question would be- does the ...
0
votes
0answers
14 views

ALLOW_SNAPSHOT_ISOLATION ON is possible on Basic Availability Group?

Is it possible to enable ALLOW_SNAPSHOT_ISOLATION and READ_COMMITTED_SNAPSHOT on a basic availability group? If yes, is there a specific procedure? Drop the database from the Availability Group ? ...
0
votes
1answer
22 views

Dates values displayed 0000-00-00

I have imported a csv file into my database created in phpmyadmin using sql. Server version: 5.6.37 - MySQL Community Server (GPL I have a column for dates which has a datatype of date. The data ...
0
votes
1answer
27 views

How to check distinct set of column values against multiple sets

I am trying to group multiple rows; aggregate distinct values in a column (for the group); and then check if that aggregate set is a subset of some other set. I spent several hours researching and ...
-2
votes
1answer
16 views

error when I try to open table on sql 8.0

I need to open table that represents what owner adopted what animal (the relation is one to many). I start with foreign keys and some columns but after I try to open that table, I get an error This ...
1
vote
1answer
57 views

Indexing Strategy for the query performance

I have a question on indexing strategy as i am trying to do indexing for a database. I understand the basic indexing strategy which are: Clustered index on PrimaryKey Add Non Clustered index for ...
0
votes
0answers
12 views

I'm trying to order a table with 3 columns as if the columns were merged into 1 such that it would sort as 3 separate entries

I've hit a somewhat unique obstacle with my current project. Below is a mock MySQL table to better describe the issue I'm trying to solve. mysql> describe `minimized_event_instructions`; +---------...
0
votes
1answer
22 views

What does this diamond shape represent in this ER diagram?

And what is testlog in this diagram is it attribute on relationship. Thanks
0
votes
0answers
29 views

How can I find where FK = PK in the same table?

I have one table named employees which contains employees' IDs (which is PK)-stands for managers-and reportsTo(which is FK). I don't know what is the correct condition to find which manager is being ...
2
votes
1answer
39 views

When to mark functions as PARALLEL RESTRICTED vs PARALLEL SAFE?

The manual for Postgres 12 says: The following operations are always parallel restricted. Scans of common table expressions (CTEs). Scans of temporary tables. ... Further down on ...
5
votes
2answers
53 views

Grouping Data Based on a Header Record

I have a spreadsheet I'm importing into the database raw, a SQL Server 2016 database. It has records in what is known as the "Lockbox format", used by banks apparently. It looks something like this ...
1
vote
0answers
8 views

Revisit SSIS: Error from ODBC provider when inserting into Always Encrypted table using CMK in Azure Key Store

I am having the same issue as SSIS: Error from ODBC provider when inserting into Always Encrypted table using CMK in Azure Key Store even with SSIS built in VS 2019 with the ODBC Driver 17 for SQL ...
0
votes
1answer
32 views

Understanding window functions to deduplicate records while retaining true changes

I am close to figuring this out but I'm just stuck at a wall. I'm attempting to understand a post by Aaron Betrand and apply it to a situation I've encountered where I have a changes table that's ...
-1
votes
0answers
4 views

SQL PHP can i check owner name and if it exist select it but if not select default 0 [on hold]

I want, when i agree 1 job i am owner in this job and other agents can not see this job but then i refresh this site if i have 1 active job i can not see other jobs, i can see only own job right now ...
0
votes
0answers
32 views

DB Maintainance Job Fails Single User Mode

we have a stored proc where we rebuild indexes and also take Backup of filegroups.Following is part of the code. But this job is failing since few weeks for error message : Error : Executing the ...
0
votes
0answers
17 views

Error message when trying to attach Adventureworks database to SQL [on hold]

I receive an error message that reads "cannot attach database with the same name as an existing database. I inadvertently downloaded the adventureworks database more than once. I try to delete them ...
0
votes
0answers
22 views

Grant `UPDATE` right on MySQL non-system schema?

After doing some tests and despite not seeing any warning in MySQL documentation, it seems that a user who has UPDATE right on all databases can do updates in the mysql.user table, and so, this user ...
0
votes
0answers
27 views

Best way to store large number of Blobs

In our production database, we currently hold 1.75 million rows of blobs (on average these blobs are less than 1MB, so we have determined that blobs are the best way forward), which takes up just over ...
1
vote
1answer
17 views

Is it safe to restart PostgreSQL if process terminated for some reason?

I am writing a docker-compose config with a container with PostgreSQL in it. docker-compose has a configuration options called restart. If I enable it then whenever the Postgres process stops it will ...
0
votes
1answer
15 views

How to query mysql tables with regular expressions?

I'm using a correct regex, already tested with other tools. But in mysql seems not to work properly. Say this data: And I want to select all the records which start with 2 non-digits followed by a ...
0
votes
0answers
16 views

Two query statament, two result set but need combine as Pivot

I have two table which record Monthly-Allowance and OT-Allowance which both table have Department column and Track column I need report that have all department but separate with Track Column 'DL','...
1
vote
0answers
26 views

Database system to store lots of large dictionaries

I have an application requirement to store a large amount of dictionaries in a database for fast reading. I know beforehand the approximate size and number of data that needs to be stored. The ...
1
vote
1answer
52 views

Backup too big to restore

I have a backup which in file explorer is roughly 160GB. If I run select sum((size*8)/1024) From sys.database_files where type=0 I get a result of 169493, fine. When I try to restore this ...
1
vote
0answers
22 views

How to force SQL Studio not to use copy-only backups to build database restore script?

How to force SQL Studio not to use copy-only backups to build database restore script? I want to ommit copy-only backup (because it's not longer available) and force studio to use last full backup (I ...
0
votes
0answers
13 views

Database design: repetitive data that needs to be uniquely identified

Imagine a project: I want to build a service containing a comprehensive list of all the books issued in a country (or in the whole world). I have access to various books databases containing imperfect ...
-1
votes
0answers
37 views

Urgent Help with stored functions in MySQL

need urgent help with this question. I do not know how to approach or tackle it. "Write the code to create a stored function isNutFree(coneNumber INT) that returns TRUE if every part of that cone is ...

15 30 50 per page