All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
54 views

See direct (instead of indirect) info about rented book in my “actors_directors” talbe dropdown list - Access365

I'm building a database of "actors_directors" who are renting "books" from my library - a kind of exercise to learn database basics :-) This is how my "actors_directors" table looks like. They are ...
1
vote
1answer
28 views

User is in multiple Active Directory groups with multiple roles in database

I have a user that is a member of multiple Active Directory (AD) groups. Within SQL Server 2012, these AD groups have been assigned to different database roles. This user is not getting the correct ...
1
vote
1answer
35 views

Do a lot of error checks affect query performance and is it bad practice?

If I have a stored procedure with a handful of error checks that come before the queries are executed and throw exceptions as necessary, could this affect performance? Is it bad practice to do this? ...
1
vote
0answers
21 views

Capture trigger update() with inserted & Deleted changes only

I have price table that has over 100 columns. I'm in the process of fine tunning triggers and reducing amounts of records inserted, to audit changes when updates are applied. The audit table ...
-1
votes
0answers
57 views

Why does this “Where” Clause break this query? [closed]

I'm having an issue with a where clause. The query works in the absence of the where clause, but not with it. I'm a mysql newb, so it is likely just a syntax issue. Any hints? USE db_x; SET @cmd:...
3
votes
1answer
30 views

Log error restoring old database to SQL Server 2017

I am trying to migrate a database from an old SQL Server 2008 R2 to SQL Server 2017. The database was originally 2000 and thus has a compatibility level of 80. Initially I took a full database backup ...
1
vote
1answer
40 views

What is the right data modeling for this case? [closed]

What is the right data modeling for this case? In my case, an application has multiple editions and each edition has multiple plans. So from that, each customer has a contract to use an application. ...
1
vote
3answers
45 views

Having md5(NULL) return a non-NULL value in postgresql

I have a table with the structure (content_md5 UUID, content TEXT), where I'd like to use content_md5 (which is the value of md5(content)) as the primary key, and use it as a foreign key in other ...
0
votes
1answer
20 views

How do I make Postgres use an index when using IN or ANY?

I have a query such as: select col1 from mytable where col1 in('a','b','c') But running such a query yields a Seq Scan per EXPLAIN If I have an index on col1, why does Postgres not do an index scan?...
1
vote
0answers
22 views

What All Is Factored Into A MySQL Checksum? (Why Could They Be Different?)

I'm currently going through the excruciating task of moving MySQL databases from one shared web hosting environment to another. This has been a multi-month battle (and I'm learning a lot). After ...
1
vote
0answers
16 views

Modeling a system with optional components

I am working on an MS Access database that is intended to help keep track of a large scale implementation of many component parts connected together. I have created a working implementation based on ...
0
votes
1answer
25 views

Postgres: Get nextval in sequence without actually incrementing sequence?

It looks like select nextval('table_name') actually does the value increment. My goal is to "predict" the nextval value on all tables in the database without actually making any incrementation. This ...
0
votes
1answer
40 views

Using letsencrypt with postgresql [closed]

I'm trying to use letsencrypt to generate certs in order to encrypt communication between a remote client and my postgresql database server. I'm not sure how to get started on setting this up. What ...
2
votes
3answers
49 views

PostgreSQL NOT IN array slow query

I have a large table with millions of rows. Each row has an array field tags. I also have the proper GIN index on tags. Counting the rows that have a tag is fast (~7s): SELECT COUNT(*) FROM "...
0
votes
0answers
9 views

How to grant a group to another group in Redshift

I am trying to build a matrix of roles to dynamically change priorities for our users. In other database I would be doing something like: create role role1; create role role2; grant role role1 to ...
2
votes
3answers
1k views

Multi-core vs Multi-CPU

I am requesting a new server from our Server team. Which is better for SQL Server performance: 2 CPUs with 8 cores per CPU or 1 CPU with 16 cores?
0
votes
0answers
35 views

How to install Postgres 12 on Amazon Linux 2? [closed]

I'm finding it really difficult to install Postgres 12 on Amazon Linux 2. AWS strongly encourages you to use their own version of Linux. It's optimized for use in their environment. Ok, fine with me. ...
0
votes
1answer
23 views

Minimizing and Handling Deadlocks Strategies

I want to discuss deadlock minimizing strategies. From isolation level to retries to different insert strategies. Lets say we have table A: CREATE TABLE `A` ( `id` int(11) NOT NULL AUTO_INCREMENT, ...
-1
votes
0answers
24 views

How to avoid users from connect to SQL server and link tables? [closed]

I am with terrible situation and this question eating my mind. we have access database with SQL server as back end all the tables were linked from the SQL server. In order access these tables from ...
0
votes
0answers
43 views

AGs or Distributed AGs for spanning a DR site replica topology [closed]

I am working on a proposal for HA and am looking to present the best options for our situation. I've been reading a few books on Availability Groups and FCIs, and am leaning towards either a 3 node ...
1
vote
1answer
67 views

SQLcl: set color in sqlprompt (ANSI/VT100 Control sequences)

This is my login.sql SET sqlprompt "_user'@'_connect_identifier > " SET sqlformat ansiconsole SET serveroutput on SET lines 3000 How to set the sqlprompt to color red for Prod (and green color ...
2
votes
0answers
52 views

Choosing between RCSI and Snapshot Isolation [closed]

I have researched into this and I understand the general differences between the two isolation levels. I would like to explain our scenario and need help in deciding the correct isolation level to use....
0
votes
1answer
18 views

DB2: how to export data file and own by db2inst1 via ADMIN_CMD

There is some requirement that I need to run the export command in Java via JDBC. Hence below is the command I execute CALL SYSPROC.ADMIN_CMD('EXPORT TO /tmp/header.csv OF DEL SELECT * FROM MYTABLE');...
-1
votes
0answers
8 views

Key points that i have to take care before designing mongodb database using Node.js for a uber like application? [closed]

Hi, world I am a newbie to MongoDB I haven't any experience regarding the MongoDB so I need your help to tell me the basic key points that I have to keep me in mind before approaching. it's ...
0
votes
0answers
9 views

Data Cube Design

I have a reporting system with many entities. I will limit this to two, players and teams, in this question, but there are actually many more. Both players and teams have many plays. The reports are ...
0
votes
1answer
79 views

Update 1 record across 135 tables

There is an application, it maintains delete flag column i.e. if a delete happen the column marked as 1 (in the deleted column). To retrieve the record I must take this 1 to a NULL There are 135 ...
1
vote
1answer
24 views

Using WITH together with CREATE TEMPORARY TABLE AS SELECT … in Postgres?

I would like to create a temporary table using a select statement that uses temporary views specified in a WITH statement (not the WITH statement of CREATE TEMPORARY TABLE). e.g. something along the ...
0
votes
0answers
12 views

Long Running Transactions with Active Status

I could see long running transactions in my Innodb Status, I'm using RDS Aurora Mysql 5.6 Version. ---TRANSACTION 977075315, ACTIVE 70113 sec 2 lock struct(s), heap size 376, 0 row lock(s), undo log ...
0
votes
0answers
9 views

Barman backup fails: reconnection not allowed

Several barman backups failed due lost connection. Is is possible to configure barman to retry backup in such case? barman show-backup psql01a 20191109T040008 Backup 20191109T040008: Server Name ...
0
votes
0answers
29 views

xp_sysmail_activate

There are multiple instance that whenever I am seeing xp_sysmail_activate running in SQL Server, DB performance is degrading. Whenever I kill the process, the database can't recover and restarting ...
0
votes
0answers
42 views

Database on secondary replica cannot join availability group [duplicate]

I am trying to add a database to an Availability Group Always On. I already have the other two DBs working fine on the same SQL Server 2016 Standard Edition Cluster (running on Windows 2016 Standard). ...
-1
votes
1answer
21 views

MYSQL-Deadlock found when trying to get lock; try restarting transaction [closed]

------------------------ LATEST DETECTED DEADLOCK ------------------------ 2019-11-12 14:20:00 0xfa4 *** (1) TRANSACTION: TRANSACTION 4519225, ACTIVE 0 sec starting index read mysql tables in use 3, ...
2
votes
1answer
69 views

Highly Available PostgreSQL with patroni

I follow this guide to set up an lab for Postgres HA. I follow exactly the guide (change the IP address in my case), after all it all work though on Postgres server 1 But when come to Postgres ...
-1
votes
1answer
28 views

Automated testing of SQL scripts

I'd like to run some simple tests on SQL scripts in CI to just ensure the scripts are valid SQL (PostgreSQL). While I could run Postgres in Docker or even use an in-memory DB such as Sqlite (it's ...
3
votes
1answer
165 views

SQLcl history (up-arrow) rewrites my queries

Version sql -version SQLcl: Release 18.4.0.0 Production I type this: SQL> exec dbaspace.long_ops; SID % Done Start Time Rem [s] Elapsed Message ==== ======= =================== =====...
-1
votes
1answer
36 views

why is the column t.idsupplier not known? [closed]

Running the below query, the column t.idsupplier is not known select t.po_nomor , p.nama_supplier , p1.nama_barang , t.total from (select t1.po_nomor ...
-1
votes
1answer
77 views

check linked servers database status

I want to find out if all SQL databases registered in the database DBConfig on the LSNR_ADMINDB are available on the respective linked server and if they are online or offline. I have the below Code, ...
-1
votes
0answers
20 views

how do i add up on sql so it doesn't double because group by

when i'm running my program, the results of the number instead make a number merge and make the number into many results. SELECT pengiriman_supply.po_nomor, data_supplier.nama_supplier, ...
0
votes
2answers
39 views

Postgres using seq scan with filter on indexed column + EXISTS on related table

I've following query which takes about 25-35 seconds to execute: EXPLAIN (analyze, buffers, format text) SELECT booking.* FROM booking WHERE booking.reference_number = '9999999999' OR booking....
0
votes
0answers
16 views

Reducing contiguous values in geographical data to a set of polygons?

I've got a MySQL table with about 200,000 rows in it. The table has four columns, lat, lng, and value. value is just a percentage, and represents your chances of seeing an aurora in the night sky for ...
2
votes
2answers
17 views

Restore mysql database with some columns content enclosed by " and another not

We have to restore a database in MySQL but some columns have content enclosed by " and another not like in this sample: 00.168.93.70,null,ES,0,htc,33a48a1515b20691,"htc;HTC One (REL4.4.2)",m7,...
0
votes
1answer
19 views

When we are estimating the table size for mySQL table, why do we add primary key twice?

When we are estimating the table size for mySQL table, why do we add primary key size twice? I saw this post How to estimate/predict data size and index size of a table in MySQL , and I noticed that ...
0
votes
1answer
20 views

what does this connection failure message mean?

$ psql -h host db_name psql: could not fork new process for connection: Cannot allocate memory I think I have enough free RAM? Other conditions, when using jdbc: Caused by: java.lang....
0
votes
1answer
49 views

Need to Free up SQL Server Memory [closed]

I am using SQL Server 2016 SP1 (production) Enterprise Edition on Windows 2016 Standard edition OS with 12 processors and 128 GB RAM.When I checked the memory usage in Task manager it went up to 98% ...
-1
votes
1answer
21 views

SSIS package not working [on hold]

Recently we moved few databases from SQL Server 2008 to 2012. Couple of SSIS package on SQL Server 2008 were dependent on it. So to update the packages so that they point to new DB Server, we ...
-2
votes
1answer
16 views

Subtracting the previous qty to the current quantities

I have a table as: Here I want to subtract the required Qty for a part from On Hand and then the result from the required for next sequence Hoping to get this as a final result:
-2
votes
1answer
36 views

Calculate nth business day of the current month

Looking for a simple inline statement (MSSQL) that can return the current workday number of the month (number of days elapsed minus Saturday and Sunday) E.g. NOV 11 2019 would be the 7th working day.
-1
votes
0answers
14 views

Are there any reference or example implementations of Financial Agreements/Contracts data models? [closed]

(cross-posted from stackoverflow - sorry if this is too vague/broad) One of the features my team is trying to build for our customer involves CRUD'ing financial agreements/contracts. I.e. a back-...
-1
votes
1answer
99 views

How to find difference between two columns in one table across the rows (T-SQL)?

I have one table called table1. This table has three columns column1 and column2 and dates_tart. Columns column1,column2 has same date type (int) and date_start has date type (date). For example, I'm ...
0
votes
0answers
28 views

Error Formatting Query, probably Invalid Parameter

I created a SQL mail job on Thursday and it runs hourly. It ran fine until Sunday at 3 for which it has been failing with the following error. Executed as user: NT AUTHORITY\SYSTEM. Error ...

15 30 50 per page