All Questions

0
votes
0answers
15 views

Looking for optimal DB design - game records

I'm designing a DB for an app, where people could save their game records and get some statistics. Game could be played 1x1 or 2x2 players. I expect ~20 active users per day, if that matters. I ...
1
vote
1answer
17 views

Force exact match from postgres ts_query

I've constructed a column of stem words called journal_tsv from the column journal_name. I've then created a GIN index on journal_tsv. Here's and example of the type of query I'm running: SELECT ...
4
votes
3answers
67 views

Is there a problem creating only differential backups every hour?

I have three databases which are not big. Every differential backup is roughly 50MB, then we have a full backup at midnight. Is there any problem doing this? I could take the full backup then logs, ...
1
vote
1answer
15 views

SQL Query for monitoring exceptions between parent/child table

enter code hereI need help with a query that I want to create. For instance, I have two tables (Process & Article). Article is the parent table what has a unique article number and in the Process ...
0
votes
0answers
12 views

Optimize query: Filter Values Contained in Multiple Ranges

Background In the fiddle below, I have two tables. The first table contains a column with a numeric value (e.g. int). The second table contains rows of numeric ranges (stored in two columns that hold ...
0
votes
1answer
21 views

How to store data in look-up tables when some of it may be semantically different, but logically the same?

I am working on a system that receives communications from various laboratories. Each laboratory has two separate, independently operated data services which means that Laboratory A and Laboratory B ...
0
votes
1answer
26 views

How can I resolve a database name to a directory?

I am connected to a database foo, and I want to resolve where the underlying directory is for that database, what are my options? Obviously I can reason from datadir, and the database name but there ...
2
votes
2answers
38 views

Selecting the same column from Different rows Based on Different Criteria

My table creates a row for each customer name for the unique customer number. CREATE TABLE #src(Number int, name varchar(32), seq bit); INSERT #src(Number,name,seq) VALUES (12345,'Mickey Mouse',0), (...
0
votes
0answers
10 views

Effect of --flush-logs on a slave mysqldump?

I have this database setup: Master -> Slave A I would like to accomplish the following: Master -> Slave A -> Slave B I have reviewed the documentation. Master and Slave A are both in an ...
0
votes
0answers
18 views

What are PostgreSQL Security Labels?

What are PostgreSQL Security Labels and how/where to use them compared to GRANT?
0
votes
0answers
3 views

SSIS setup and loading bulk CSVs into SQL

I'm trying to setup a SSIS to load bulk CSV files into sql server, but i'm getting the following error. Can you please help with the resolution. Warning: 0x80019002 at Package: SSIS Warning Code ...
0
votes
1answer
22 views

Why is pg_stat_activity.query_start null for almost all queries? [on hold]

Why is pg_stat_activity.query_start null for almost all queries? What is the meaning of a NULL query_start field?
-1
votes
0answers
29 views

System Maintenance job getting failed at reindexing step [on hold]

i am trying to find reason why system maintenance is failing at re-indexing step. anyone knows proper reason of failing job .please let me know . See the msg :The package execution failed. The step ...
1
vote
1answer
40 views

Equivalence of correlated DATEADD intervals

Is there any difference between the following statements? SELECT DATEADD(MONTH, @SomeInteger * 12, @SomeDate) SELECT DATEADD(YEAR, @SomeInteger, @SomeDate) In other words, are there any cases in ...
0
votes
0answers
17 views

Mongo zoned sharding with a single value

We have a database with around 50 collections, and 70 million records. All records belong to specific customers and have a customerId property. Currently all clients are in the USA. However, we're in ...
1
vote
0answers
52 views

Deadlock on two update statements on the same page

I'm receiving multiple deadlocks in one SQL Server. The deadlocks occur when the same query with different parameter values is being issued on the same database: Example: Query 1: UPDATE Tabel1 ...
0
votes
1answer
43 views

Drop the user from Read only Secondary database Always ON server

How to drop a user from the secondary database in an AG when it is in read only mode and synchronizing in SQL Server 2012? The login and user have been deleted from the primary database, and we are ...
0
votes
2answers
31 views

Database not going into single_user mode

I have a corrupt database with wrong checksum error. When I try to put database into single_user mode to repair it gives following error. I am using following sql command from management studio to put ...
-1
votes
0answers
21 views

Script to fix MySQL columns to work with strict-mode [on hold]

I'm trying to build a script to generate ALTER TABLE queries so that across whole schemas, columns are adjusted to be compatible with MySQL strict-mode.. I want it to be a simple as possible, making ...
6
votes
1answer
546 views

Why am I getting the error “non-boolean type specified in a context where a condition is expected” for this request?

I am getting this error : "Error 102 : non-boolean type specified in a context where a condition is expected" for this request : DECLARE @num_dossiers TABLE (num_dossier INT,indice NVARCHAR(3)) ...
0
votes
0answers
20 views

Update column without dropping dependancies

I have a table with many dependancies such as: functions, views and materialised views. I'd like to update a column from an int to a bigint. The issue I have is that doing so requires dropping a ...
1
vote
2answers
25 views

update older records in each group

There is a set of data, like | id | serial | version | is_deleted | -------------------------------------------------- | 10 | AAAAAA | 2019-04-14 15:28:08 | 0 | | 22 | AAAAAA | ...
2
votes
1answer
57 views

SQL binaries on C drive?

We are setting up a new SQL Server with over 2 TB size of Database, and this is a heavy OLTP. Let me know, if there is any impact of placing SQL binaries in C drive? or i would need another Drive? ...
0
votes
0answers
46 views

Why can't SQL Server handle into's in 2 parts of a script? [duplicate]

I noticed some behavior I found weird while editing a co-workers stored procedure: create procedure weird_behavior (@switch bit) as if (@switch = 0) begin select * ...
5
votes
0answers
51 views

Alwayson AG lease timeout and healthcheck timeout

We have a physical SQL Server 2016 Enterprise SP2 with two instances and each instance contains one AG. Sometimes it happens that one AG goes to resolving (without failover), the cluster resource is ...
2
votes
3answers
84 views

Is there a way to retrieve the logical filename from a backup file?

I would like to write an automation script that restores a SQL Server DB from its backup file. However, doing this is not a straightforward procedure in SQL because the main query needs additional ...
1
vote
3answers
34 views

When I connect to DB, always connects as tempdb

I am trying to run a sybase DB query from a jsp session. I can connect to the DB fine, but when I run my query, by default it always runs against tempdb. Is there a way I can make a connection to ...
0
votes
0answers
34 views

I can not Ola Hallengren database backup script to Data Domain make works

Ola Hallengren has a nice SQL Maintenance scripts that I installed to our dev SQL server. The backup script works very well to a local drive, however it does not work to Data Domain. At all. Here is ...
0
votes
0answers
20 views

document creation for sql server tables [on hold]

Hi How can i write documentation for end user(User friendly) Based on the views from the database.Which columns we are taking from which tables Document this information in a document with a user-...
1
vote
1answer
21 views

Would SQL Server Profile show triggers or other code which run as a side-effect of the query I'm profiling?

I've been using profiler to test a massive script I'm running in order to check for unintended side effects, e.g. triggers that I don't know about running because I've updated data in a certain table. ...
1
vote
2answers
22 views

Postgres - Where condition on nested joins table not working

I have 3 tables: order_items, invoice_items and invoices In order_items model: has_many :invoice_items P.S an order_item may or may not have any invoice items associated with it In Invoices model: ...
1
vote
0answers
10 views

sqlplus connection to Oracle 11g takes much more time to establish than from another machine

I have an existing Ubuntu 16.04LTS 64bit system that connects to Oracle 11g (11.2.0.4.0 64bit/Windows). From that Linux machine I can connect to Oracle via sqlplus instantly, using sqlplus uid/pwd@...
1
vote
0answers
15 views

Spatial index unused on nested set

I'm using the nested set architecture to store URL hierarchies in the following InnoDB table on MySQL 5.7. From my research, I've learnt that using a SPATIAL index will significantly speed up any ...
-2
votes
0answers
21 views

Convert Unix Time into Last 2 Weeks Data [on hold]

I'm very new to SQL, but I'm trying to run an existing SQL query, but with only the last 2 weeks of data, where as the existing Dataset pulls the data regardless of when it was created. Our ...
0
votes
0answers
11 views

Synchronizing MySQL Data with different Organisation order with multiple same id

I have 2 servers with MySQL database.Organization1 uses one server and organization2 uses another server. Lets say organization_id=1 has an order with order_id=10 and another organization_id=2 also ...
-2
votes
0answers
38 views

Codd's rules demonstration [on hold]

I am new to databases and I'm trying to understand Codd's rules. I have searched the web but I didn't manage to find any source to see a demonstration of Codd's rules. I am working on the database ...
0
votes
1answer
30 views

How to force SQL developer to use imp/exp command while import/export

While importing or exporting oracle data dump using SQL Developer by default it is using impdp command for import and expdp command for export. But I want to import a dump which is exported using exp ...
1
vote
1answer
24 views

How to remove duplicates values within particular ID

Im struggling with removing duplicate values within certain employee ID. Here is the situation: ID || VALUE1 || VALUE2 || DATE 11 || Position1 || Other1 || 2019-04-04 11 || Position2 || ...
0
votes
0answers
17 views

HA PostgreSQL installation using patroni and pgbouncer

I'm not having a problem yet, just searching for advise I want to build installation of PostgreSQL on 3 nodes using patroni: master and 2 standbys (for failover only). There are PostgreSQL and ...
0
votes
0answers
21 views

mysql8 gives “Access denied for user” error with php but not navicat/workbench

I have been reading billions of answers/questions for that same error : SQLSTATE[HY000] [1045] Access denied for user 'root'@'ALEXPC' (using password: YES) I myself even handle this error like ...
1
vote
0answers
35 views

How do I add and/or modify $jsonSchema for a MongoDB collection from within the NodeJS driver? [on hold]

I would like to use the MongoDB native schema functionality in a Node application using the MongoDB NodeJS driver. I do not want to use Mongoose for this. Mongoose has it's own implementation of ...
1
vote
1answer
17 views

SQL Services Wont Start After Removing TLS [duplicate]

I need to remove TLS 1.0 from one of my SQL servers. When I do so and then reboot the server the SQL services dont start automatically. When I attempt to start them I get an error that it cant be done....
0
votes
0answers
27 views

Create SQL Server Agent job for stored procedure with input parameter

Could you suggest please how to create SQL Server Agent job for a stored procedure that have 1 input parameter? The procedure is correctly created and i executed it using this code : EXECUTE dbo....
0
votes
2answers
21 views

Mongodb replace default _id with string

I replace MongoDB default _id with type string. And now I want to sort my collections, the result _id after sort is: 1 10 100 101 2 20 200 I want the result like sorting number which is: 1 2 3 4 5 ...
4
votes
1answer
789 views

How do database operations (write, update, alter) on particular cell in a table are written to disk without overwriting entire file?

When I want to write to or alter particular cell of an excel file/table using python I'll use pandas read_csv then alter value in particular cell and write back to file with to_csv. But writing back ...
1
vote
1answer
45 views

SQL Server - Queries are much faster on the application when run second time

When I click on a screen on my vb application, it takes approx 6/7 seconds to display the results. When I click off the screen and click back again into the screen, it returns immediately. I ran ...
0
votes
0answers
8 views

How to optimise PostgreSQL planning time

I have a small query using postgresql 9.6.11 and postgis 2.3.1+dfsg-2 select ST_Transform(ST_SetSRID(ST_Point(671699.9999988,6585300.5001232),32633),3006); that is slower than I like for where it is ...
0
votes
0answers
12 views

How to consolidate Date column? [on hold]

how to consolidate magento datebase date column. Following is my order table, how to consolidate date column 2019-01-01 10 2019-01-01 20 2019-01-01 30 how to consolidate like, 2019-01-01 ...
0
votes
1answer
30 views

Combine many table into one table in mysql table design

I'm grappling to design table relation. Version is Mysql 5.6.10. My case is like below bill table, payment table, contract table, recruitment tables... are existing. Currently we're considering new ...
0
votes
1answer
13 views

How to close mongodb idle connection(active: false)?

I have an application running on node and using the mongodb library to establish connection and closing it. But the problem is, from the mongo serverStatus() command i can see that there is still 2k+ ...

15 30 50 per page