All Questions

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

Sql Server - Get database constraints of all tables ( default and check constraints)

I need to get constraints of all columns, tables in my database result like this : DatabaseName | SchemaName | TableName | ColumnName | ColumnType | ConstraintName | - ConstraintType | Definition | ...
0
votes
0answers
3 views

OpenProject pg_restore - input file does not appear to be a valid archive

I'm trying to restore my OpenProject's database created with the command sudo openproject run backup this command created the file postgresql-dump-20190722131834.pgdump which I'm trying to restore ...
0
votes
0answers
6 views

slow count queries - what are we doing wrong?

Using Postgresql 9.6.14, running the following query: SELECT COUNT(*) AS "__count" FROM "crm_client" INNER JOIN "crm_role" ON ("crm_client"."role_ptr_id" = "crm_role"."id") INNER ...
0
votes
4answers
19 views

How to check 'contains' in sql?

Suppose 'allotedTo' column contains multiple values like 'ABC/xyz/RAM' How do I load all rows, with 'allotedto' column containing any one of given input values? (eg: all rows alloted to RAM or RAJ) ? ...
0
votes
0answers
6 views

Good reference for “database assertion” or “multi-row-constraint”?

These days I am writing some technical documentation. I am looking for a good reference where "database assertion" or "multi-row-constraint" is well-described. Explained in simple terms. I just want ...
0
votes
1answer
8 views

How to check and change function volatility in Postgres?

I have a function that I think is defined as volatile, but I now know I want it stable. How can I check the function volatility (volatile, stable, immutable) of a certain function? When a function ...
1
vote
1answer
5 views

Db2 REORGCHK returns the SQL2310N (Error “-668”) message

I have a Db2 database on my Linux laptop. The database is not heavily loaded. I access it from time to time for the development purposes. I removed a column: db2 "alter table SCHEMA.TABLE drop ...
0
votes
0answers
8 views

Subquery caching in join

I have very complex MySQL queries that use the same subquery over and over again. I was wondering if MySQL will run the subquery multiple times or use the previous resultset. Is there any way to tell ...
0
votes
2answers
20 views

should i create a new table or save static data in all the tables

I'm using postgres database, currently I have countries table, which has only 4 countries (might add 1 or 2 more countries later) Table 1 : countries country_name India USA UK Australia I have ...
0
votes
0answers
11 views

Psql, cte twice for same thing return bad value

What I need. Same values for category tree as in first case, first case is for name (cte), second is for id (cte2). What I tried. with recursive cte as( select category_id,category_parent,...
0
votes
0answers
29 views

Setting up TempDB for more than one instance of SQL Server

I've been given the task of transferring the contents of a SQL Server instance from one Windows server to another Windows Server. One of the many things I need to do on the new server is set up the ...
0
votes
1answer
31 views

All my database on the fail over server showing in “Synchronizing” state

Current Configuration: I have two SQL server, which is connected on the failover mechanism which means one is primary and one is secondary. What did I did? I just restarted both the services on both ...
0
votes
0answers
3 views

Elastic search data synchronization with different databases

We are using elastic search hosted in AWS for apps wide search in our organization. We had initially dumped our existing data using logstash. However, we are struck at keeping the Elastic DB in sync ...
0
votes
1answer
33 views

Non Clustered Index using INCLUDE

I am working on Consolidation INDEX. I have 3 index on a table Create NONCLUSTERED INDEX IX1 on TableA(a asc,b asc) INCLUDE(U,V,X,Y,Z) Create NONCLUSTERED INDEX IX2 on TableA(a asc,b asc) INCLUDE(K,L,...
0
votes
1answer
20 views

Is it possible for a node to host multiple cluster in relation to Always On AG

In my example, I have 3 database servers with their own DR servers, own availability group, own clusters. Is it possible to setup another server which can be part of the 3 clusters and be a secondary ...
1
vote
1answer
9 views

How to find resource intensive SQL operations in Postgresql? High CPU usage spike

I am getting frequent high CPU usage alerts from production DB server. As I want to investigate more into this by my own, I have collected the running DB queries for that high CPU usage time period. ...
0
votes
1answer
12 views

TSQL - use columns as date range

How can I retrieve the cto column using an @variable? For example, for @Variable = '2019-03-02' the expected output is'MAR 1 - MAR 7'.
0
votes
0answers
9 views

MSSQL transactional replication is out of sync

I have setup transactional replication in MSSQL and I am using PULL to retrieve the data from the subscriber. Recently, I noticed that the data in my subscriber is not synced up with the database on ...
0
votes
1answer
18 views

How do writers not block reads in PostgreSql

Since readers do not block writers and writers do not block readers is what MVCC is all about, how does postgresql prevent writers who are in the process of committing their changes to blocks/pages ...
0
votes
1answer
2 views

ibdata1 back to it's original size after deleting it

I have followed the following steps in order to save space but I am surprised after restarting MySQL ibdata1 gets back to it's original size. As you want to reclaim the space from ibdata1 you ...
-2
votes
0answers
13 views

Which database to use? Storing one string every second for several days

I would like to observe some cryptocurrency prices and for that, I want to store a string, everey second in a database for ca. 3 days. The string will vary in length, it will be 2500 characters max. (...
0
votes
1answer
21 views

How do I find a list of customers that have not placed an order in the past 1 year?

I'm having trouble figuring out how to write this query: We have a sales table but the sales table only represents customers that have purchased. We have a customers table that represents all of the ...
0
votes
0answers
11 views

PANIC HELP Locked out of Postgres Databases and unable to find pg_hba.conf

I am using PgAdmin 4 to access a number of local databases created and hosted on postgresql 11. In a recent update, I set a global password for my databases, but forgot to set passwords for my user ...
0
votes
0answers
7 views

Rename big Postgres table?

I have a table with 800 millions rows in data warehouse. And there is a time when it is not used. Is it time consuming operation to rename it with ALTER TABLE table_name RENAME TO new_table_name; ...
0
votes
0answers
9 views

Errors reading and writing communications packets

After an outage that had us down for 4 days I am attempting to establish replication between 2 of our servers in order to have a "hot" backup available should the need arise. After dumping all of the ...
2
votes
1answer
29 views

Graphical Actual Execution Plan - Estimated vs Actual number of rows

I am using: SQL Server Management Studio v18.1 SQL Server 2017 CU9 AdventureWorks restored from here Test query: USE [AdventureWorks]; GO SELECT TOP (13) * FROM Sales.SalesOrderHeader AS s ...
0
votes
1answer
12 views

Sequelize: destroy not working

I have the following code: return this.destroy({ where: params.activities }) ... where params.activities is assembled from: result.forEach(function(object) { activities.push({ id: ...
0
votes
0answers
17 views

PostgreSQL create windows authentication

Setting up PostgreSQL for the first time. I'm trying to create domain logins. "MYDOMAIN\Delizat" Anyone have any tips or links that would be helpful? Thanks, D
0
votes
1answer
21 views

Execute SSIS procedure from stored procedure using non-privileged SQL login

I have a web app running on a different server that uses a SQL based login (not a windows based login) to connect to the SQL server. That app is calling a stored procedure that is located in a ...
0
votes
0answers
29 views

sp_displaylogin (Sybase/ SAP ASE) equivalent in MS SQL Server

In Sybase, sp_displaylogin would return these details Suid: xxx Loginame: Fullname: Default Database: Default Language: Auto Login Script: Configured Authorization: Locked: Date of Last ...
0
votes
0answers
13 views

Help with a ER model re Manager Entity

In the below ER model: A manager can have many Users but a User can only have 1 Manager A Manager must be able to assign multiple users to multiple courses Are the manager relationships correct?
0
votes
0answers
15 views

Performance Problems with MongoDB Atlas M0 with Larger Documents

Problem Description Our team is developing a small web application for an academic research project, which is currently hosted on Heroku and connects to a MongoDB Atlas M0 (Free Tier) database. The ...
0
votes
0answers
7 views

MySQLRouter on Windows 10 Unable to connect to the metadata server

I have set up a set of three MySQL 8.0.17 databases using group replication. They are all on my Windows 10 PC, using ports 3306,3307,3308. I am now trying to set up mysqlrouter. I have installed it ...
0
votes
0answers
13 views

oracle dbca do not start

I need to create a new instance in an existing installation in 11gr2, but despite having configured the variables of the new instance, executing the dbca does not start, and no error message is ...
0
votes
1answer
21 views

Adding subscription for replication in sql server

when i am trying to add subscription on subscriber part in SQL server. error be like : This database is not enabled for publication. Can you please suggest me how to solve this issue.. Note:IS ...
0
votes
0answers
50 views

Reproduce Deadlock in SQL Server

I have identified a deadlock by using Solarwinds, I have noticed that it is happening in a specific table, that table only has a primary key, which tells me that the deadlock makes sense since every ...
0
votes
2answers
22 views

Can someone help me with this MySQL code?

I want to retrieve some date from 2 different tables action and staff. This is my code: SELECT ActionID, FeedbackID, StaffID, ActionDate, ActionDetails, (SELECT StaffName, Department ...
-1
votes
2answers
46 views

Need to accumulate values based on ranges from another table in SQL Server

I need to 50 accumulate values based on ranges stored in a separate table. The table that stores the ranges looks like: If the level is -1 then that is the top most level. So for values at a certain ...
7
votes
5answers
733 views

how to add 1 milliseconds on a datetime string?

Based on a select, I can return x rows like this: 1 2019-07-23 10:14:04.000 1 2019-07-23 10:14:11.000 2 2019-07-23 10:45:32.000 1 2019-07-23 10:45:33.000 We have all milliseconds with 0. Is ...
0
votes
1answer
45 views

SQL Server process suspended while executing simple SQL (one row deletes and selects)

We have a problem on MS SQL Server. Processes get suspended. Looks like it is caused by simple SQL queries like Delete from x where id = @x, or select * from table where id = @x. Several similar ...
0
votes
0answers
12 views

LibreOffice Base Brings in all visible databases as list of tables

I'm trying to connect to a singer database through LibreOffice Base. The connection goes fine and successful. However, when selecting tables, it's showing a list of all the visible Databases in the ...
1
vote
2answers
37 views

Show Primary and Secondary Accounts in a table

I have a table that provides the relationships between Primary and Secondary accounts which looks like this: CREATE TABLE testRelate ( AccountRef nvarchar(20) PRIMARY KEY, RelationshipType ...
0
votes
0answers
5 views

Find an equivalent way to make “$setIsSubset” with AWS DocumentDB

I need to find another way to make this operation : "$setIsSubset" with AWS DocumentDB (MongoDB like). I'm not an expert with the mongo request, but I need to convert this instruction for my ...
0
votes
1answer
23 views

How to store a risk-like game map

Imagine a multiplayer online game like Risk where there is a map represented by a NxN grid. Each cell can be free or occupied by a player. When a player access the page, the grid is displayed. ...
0
votes
3answers
41 views

MSSQL Mirroring + db integrity check

Is it necessary to do a database integrity check (DBCC check) on mirrored databases? https://docs.microsoft.com/en-us/sql/sql-server/failover-clusters/automatic-page-repair-availability-groups-...
1
vote
2answers
49 views

Setting a date dynamically

I would like to set a date dynamically in the where clause of my query but I can't figure out how to do it. The query is doing a count of the number of rows with an entered on date >= 1st August ...
1
vote
0answers
24 views

selecting data after filtering out

I am using RDBMS MySQL 5.7. I have 3 tables with the following structures: Table A - primary table - products: +----+-----------+-------------+------------+--------+ | id | title | description |...
1
vote
0answers
25 views

SQL User vs AAD for Azure SQL Managed instance

It appears the app response is much slower when it uses the AAD account to access the Managed instance compared to using a SQL user (SQL Auth). Can anyone please shed some light on whether this is ...
2
votes
3answers
52 views

Is it better a composite index (item, item_type) or single-column index on item_type_1, item_type_2, …?

We have items of three types to be stored and queried according to some business logic. create table a_table ( item_a varchar2(30), item_b varchar2(16), item_c varchar2(2), -- other ...
1
vote
0answers
19 views

Multiple join with self join in MySQL and split column in row

I have four tables "Commission" , "Vendors", "Accounts" and "comsplitconfig" like commission Table commissionid vendorid accountid sales commission 1 V1 A2 ...

15 30 50 per page