All Questions

Filter by
Sorted by
Tagged with
-1
votes
0answers
13 views

Indexing strategy for optional predicates

Let me ask a similar question i asked before. I believe there is more scope of explanation on this one. CREATE TABLE [dbo].[SalesOrder]( [Id] [uniqueidentifier] NOT NULL, [PageId] [...
0
votes
1answer
14 views

New to CTE - How to do a count after making table unique

I'm new to CTE's and usually sub query my SQL. I'm unsure how to get the results I want as I keep finding solutions that would require sub queries. I have the below table in SQL. I'm trying to write ...
0
votes
1answer
21 views

SQL cannot add columns to query

I have the following query (PostgreSQL 9.5.19): with userlist as ( select a.ips, array_agg(t.super_user_id) as super_users from tmp_table_1 t left join unnest(t.ips) as a(ips) on ...
-2
votes
1answer
12 views

Create a trigger that will prevent any one from updating personal information of others

I'm trying to create a trigger in DB2 that will prevent any one from updating any personal information that does not belong to them I.E. FIRST_NAME, LAST_NAME, EMAIL , PHONE_NUMBER columns. I'm trying ...
0
votes
0answers
19 views

Stored procedure execution duration and sending email to DBA if it run long

Does anyone has a T-SQL query which checks the stored procedure run duration and inform DBA team if it run long may be more than 1 min. Any help would be appreciated Thanks
-1
votes
0answers
19 views

can anyone answers these im new to database

a. List the first name, middle initial, and last name of all employees who earn a salary greater than 27,000. b. List the first name, last name, and address of all employees who have a son as a ...
1
vote
0answers
15 views

(MySQL) SET column with values from a foreign key constrant

I am making a junction table that tracks relationships between users. Among other things it is formatted with a group leader, and with a variable amount of members. All users have a user id and so ...
1
vote
0answers
10 views

Oracle 12c Database Config Manager very slow at creating a new database

I have installed Oracle 12c on a number of machines (Windows 10, 2012, 2016 mostly) before and created several databases on them, using the Database Config Manager, all with no real hiccups. However ...
0
votes
0answers
8 views

Converting this Postgres query to sequelize

Hi I'm trying to convert my query into a sequelize query but I haven't been able to do it, The query is: SELECT SUM(od."totalValue") AS total FROM "OrderDetails" AS od LEFT JOIN "Orders" AS o ON od....
1
vote
0answers
9 views

Missing CALLs on identifiers_all using PL/SCOPE

Posted this on StackOverflow, but maybe this is the right place for it: I'm trying to use the view all_identifiers from PL/SCOPE to find out calls to procedures and functions but it's not showing all ...
0
votes
0answers
4 views

How do I troubleshoot FILESTREAM_WORKITEM_QUEUE waits in SQL Server 2014?

Env: SQL Server 2014 SP2 on Windows Server 2012 R2. I am seeing our top wait as FILESTREAM_WORKITEM_QUEUE, with average waits near 1s and over 5000 waits during a 2-hour period of time. I haven't ...
1
vote
0answers
7 views

How does one determine the number of FACT tables that are required in a data-warehouse?

When analysing data sources that need to be included in the data-warehouse (Kimball), how does a developer determine whether a schema should be a star type or constellation type? Business processes ...
1
vote
0answers
6 views

mongodump fails after exactly 10 minutes

Using single instance MongoDB v4.2.0 on Debian 9.11 with collection of 78GB and 60M documents on a 2 vCPUs, 13 GB memory server. This command is invoked on the same server where database runs: ...
-1
votes
0answers
19 views

How to get all previous week record by using creating a imaginary column

I have problem an now this is more than 2days and I can't find any answer. can you help me out guys. to solve my problem. I use Server version: 10.4.6-MariaDB Question: How to get the all records ...
0
votes
0answers
10 views

How to select a regexp_replace return value from a mysql table?

I have to make some transformations to some values from a mysql table. I tried something like this: SELECT REGEXP_SUBSTR(t.CategoriaCatalogo,'\/pdf.+\.pdf') pdf FROM V36_cats_update_test t But I get ...
0
votes
0answers
16 views

Return the last purchase for each item in a group

I'm trying to calculate the cost to make one product, for this I have a table with the data sheet to build each product. So, for example, to make the Product A I'll use item a, item d and item g. ...
0
votes
2answers
25 views

Can't see process progress, machine getting slow trying to import 500 million records

Working environment: PostgreSQL 12.0, Ubuntu 18.10, 4GB memory, i5-3230M CPU @ 2.60GHz × 4, Os 64 bits I'm trying to import a .csv file with more than 500 million records into a PostgreSQL db table, ...
0
votes
0answers
13 views

Create a user on database A with a procedure from database B (with EXECUTE AS)

I have 2 logins : LoginA: role dbcreator + CONNECT ANY DATABASE LoginB: role sysadmin I have 2 databases : dbA: everyone has all rights on it dbB: only LoginB has rights on it, LoginA is only the ...
0
votes
0answers
26 views

Does SQL server support an in-built mechanism to copy a row to a log or history table when it is updated?

Is there an in-built mechanism that copies a row to a log or another table when it is updated. Or is the only option to write a custom trigger on update.
0
votes
0answers
17 views

Issue with table naming policy with PBM - can't create it passed in the condition or not

I used PBM to create a condition to blocking create tables if nomenclature no haven't the prefix tbl: EXEC msdb.dbo.sp_syspolicy_update_condition @condition_id=24, @description=N'Necessário ...
0
votes
0answers
8 views

How to create a linked table to an SQL global temporary table

In my Access database VBA code, I would like to create a linked table to a global temporary table in SQL Server. I can't seem to get it to work. This is what I have tried: Dim adors as new ADODB....
1
vote
1answer
18 views

SQL Server Dynamic Group By

I want to create a de-dupe (remove duplicates) records (actually Guest Profiles) from a table (TableA). The user can opt for 5 criteria (Surname, Name, Email, PostCode,Phone). This means it can create ...
0
votes
0answers
15 views

Order by inside the LEFT JOIN

I am trying to write a query. I got it work half way, but I am having problems with the LEFT JOIN. I have three tables: user user_preferences user_subscription_plan User will always have one ...
0
votes
0answers
18 views

FTS is slower on tsvector than text

I tested the performance of searches on two columns : text, tsvector. Somehow it appears that tsvector is slower than text. Also, there's some incosistency with planning time and execution time. It ...
1
vote
1answer
26 views

Can the SQL Server optimizer use indexes to update auto created statistics?

Consider the scenario where auto created statistics are created on a column to satisfy a query. Afterwards; a nonclustered index is created on the column, with or without other key columns. Could ...
0
votes
1answer
20 views

SQL Query- field calculation based on date

I'm writing a query for sales targets per week, however I'm getting a little stuck on this. Targets are per month, per year, so for example, Brand A has a monthly target (changes each month) The ...
1
vote
0answers
31 views

SQL Server mixed mode authentication not being set

I have a local developer instance of SQL Server installed on my machine. I set the mixed mode authentication: Open SSMS Connect to localhost (windows auth) Right click localhost connection, right ...
1
vote
1answer
17 views

Is partial dependency possible In Data Base for Foreign key relationship

I have 3 table Student,Teacher,User. Student: CREATE TABLE Student( id INT NOT NULL PRIMARY KEY,name VARCHAR(50) NOT NULL); INSERT INTO [dbo].[Student]([id],[name]) VALUES(4,'Ram'),(5,'Raman'); ...
0
votes
0answers
16 views

PostgreSQL - add columns to query (fiddle example)

I am using PostgreSQL9.5.16. I have the following query: https://www.db-fiddle.com/f/geB9V6TdHEkF2mSqpd2b4g/1 (the expected results are shown in the comments) It works fine as is, but I am trying ...
0
votes
0answers
18 views

Unable to connect to SQL server instance ubuntu 18.04 via SSMS which worked peviously

I am running SQL server on ubuntu 18.04 which I was able to connect to successfully via SSMS. But I am not able to connect anymore. My first instinct was to check if the SQL server was running by ...
0
votes
1answer
20 views

Documentation on usage of brackets() in mysql queries

I have an application where i am needed to write queries with multiple conditions and i am using several other keywords such as between, and, or etc I have this two conditions select * from ...
0
votes
0answers
4 views

Occasional “access denied” on a persistent SSL connection, to MariaDB, from PHP

When using SSL to connect to a MariaDB instance on Amazon RDS, I'm able to setup a persistent connection, and login almost every time. But I will occasionally get: [Warning] Access denied for user '...
0
votes
1answer
9 views

How to select any couple of digits except '00' using mysql regex subset syntax?

I just found out that mysql doesn't support full regular expressions syntax. I have to select any couple of digits except of 00 (so, 11, 54, 02, are ok, but not 00). Normally I would use a negative ...
0
votes
0answers
10 views

What platform is suitable for real-time aggregation of analytics for matching records? [on hold]

Our application has several million records each having thousands of daily analytic data points. We need a way to filter records first by multiple criteria (full text search included), and once it is ...
1
vote
2answers
15 views

Entity Relationship Diagram - Entity depending on attribute

I have an ER-Diagram containing the entity employees. When employees have high skills they may supervise lower skilled employees. How can I model that in an ER-Diagram? My initial approach of was to ...
0
votes
1answer
13 views

how to make error log visible in ubuntu

despite starting mysql sudo service mysqld start How to give permission to var/lib/mysql
0
votes
1answer
20 views

Where is documented that no other transaction can update a locked row?

In the manual for InnoDB Locking, it is stated how shared and exclusive locks work. As I found out by trial and error, both LOCK IN SHARE MODE and FOR UPDATE ensure no other transaction can update ...
2
votes
1answer
103 views

Add banner motd to postgres database

I would like to present a banner motd (message of the day) to users that connect to a Postgresql database. Similar to cisco router and switch cli where you use: banner motd "Seien Sie bitte ...
0
votes
1answer
3 views

“Cluster nodes” command showing different status on different Redis Cluster nodes

I had created a redis cluster of 6 instances running on 2 RHEL-7.4 servers some time ago. Today I found that 3 of those instances(on 10.32.129.79) were down. Since I've restarted those 3 instances, I'...
0
votes
0answers
14 views

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

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
6 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
0answers
12 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
23 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
23 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
16 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
18 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
14 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
19 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 ...

15 30 50 per page