All Questions

1
vote
1answer
12 views

Get the combined row count by month from 3 tables

Using Postgres 10+, I have three tables with similar structures, where I'm trying to get a count of rows grouped by months. I have a functional query working for two tables, as below: CREATE TABLE ...
2
votes
1answer
23 views

Why is an empty rowset not equivalent to null when assigning a query result to a variable and how best to work around?

I have a cursor. Within my loop I select a single column and assign the result to a variable. When the select returns an empty rowset, nothing is assigned to the variable. In particular, the variable ...
0
votes
1answer
33 views

How can I use Count() or Sum() with advanced criteria such as matching the most recent rows where a condition is true?

I have created a table with the following structure: | ID | RecordDate | SerialNumber | ProductID | StageID | Result | |----+------------------+--------------+-----------+---------+--------| | ...
0
votes
0answers
7 views

Blocked Process Report

I have tons of BPR in .xel file (XE) and I want to be able to view them in a graph form and dump them all in SQL Server table, is there any way to do so? Instead of the 5 sec threshold is there any ...
0
votes
1answer
90 views

#1146 table 'db.tablename' doesnt exist

I use AMPPS for localhost server purpose. I was working on one of my client site on localhost. When I start working the other day, it suddenly start giving me such error table does not exist Even ...
0
votes
0answers
11 views

Lock pages in memory for system accounts

Yes, well where to start? If you really enjoy installing and fine-tuning Microsoft SQL Server or Oracle RDBMS instances on Microsoft Windows Server, then at some point you will all come across the ...
0
votes
0answers
13 views

MySQL Internals: SQL Execution Flow

This is a descriptive question regarding MySQL SQL flow architecture. I need a flow chart on the complete steps regarding MySQL SQL flow using the following components. eg the sequence an UPDATE query ...
0
votes
0answers
9 views

Copy OID field into remote postgresql DB

We have configure postgres_fdw to move data from a db to remote db. It works fine but the OID field's data in source db not getting copied to remote DB. INSERT INTO archive_remote.target_db(id, ...
1
vote
1answer
266 views

CONCAT() between different alphabet echoes out '&' ampersand

I want to concatenate different alphabet strings and get a weird latin encoding with ampersands after the sixth greek character (I want to concatenate greek and english alphabet strings). Lets say I ...
36
votes
2answers
47k views

ERROR: no schema has been selected to create in

I am working on an amazon RDS postgresql database where I know there had been some issue with the public schema (maybe it was dropped). But apparently the schema exists, and anyway the problem is not ...
0
votes
0answers
17 views

SQL-Server schema audit trigger - possible to get old view/sp/function definition?

I'm using the below database-level trigger for schema-change-auditing. It works fine, but if I do (drop view - create view), it only stores the sql that created the view, not the one that is dropped. ...
8
votes
1answer
177 views

SQL dumping all pages from buffer cache every few minutes

I have a single SQL2012 SP4 node running several databases. The server has 20GB of memory available, 14GB allocated to SQL (nothing else running on the box). Every few minutes SQL dumps the whole ...
0
votes
0answers
10 views

How to set up alert emails SAP HANA?

I want to configure emails for alerts(when backups fail) in SAP HANA Database. From Cockpit -> Configure Alerts, I've set up SMTP information and also created default recipients. Now alerts run but ...
4
votes
3answers
14k views

what is the difference between mysql community server and mysql cluster

I am starting to look into different database's for different use cases. I see there is a mysql community server and mysql cluster. What is the difference between the two? Are they both database ...
1
vote
1answer
246 views

table is — is full mysql

MySQL 5.7 on windows'12 server, table which I am getting error crossed 2 GB in size, server memory is 4 Gb, MySQL used about 90% of memory.. Now any insertion into this table causing table full Once ...
10
votes
3answers
326 views

Filter condition not correctly applied to Clustered Columnstore index

Using the below example, the predicates are the same, however the top statement (correctly) returns 0 rows, the bottom statement returns 1 - even though the predicates do NOT match: declare @barcode ...
-1
votes
0answers
35 views

SQL Server select query performance improvement [on hold]

We have a requirement of creating a query by joining more than 50+ tables and display the results. However it is taking more than 30 seconds to get the results. All data to be mandatorily retrieved. ...
0
votes
0answers
13 views

Blog database, and multiple categories

I have 3 tables. A table called blog_posts which has your traditional blog fields like content, image, .etc. and a table called blog_categories which stores a number of categories a blog can be ...
-1
votes
0answers
22 views

How to use “group by” while joining two tables with one to many relationship for the many (70+) columns?

I have 2 tables: A: |c1 |c2 |start |end | ----------------------------- |a |11 | | | |b |11 | | | |c |11 | | | B: |d1 |pos |d3 |.....
25
votes
1answer
1k views

SQL Server 2017 crashes when backing up because filepath is wrong

I was trying to restore my database and SQL Server kept crashing. I would get a message in SSMS that said there was a network transport error (the connection dropped bc the crash). I checked the logs ...
2
votes
2answers
21 views

Breaking out of a recursive query in Postgres 11

I'm having some trouble getting the correct data out of a tree structure, where I only want the first nodes in a branch matching criteria to be the result of the query. I have this table of domains: ...
0
votes
1answer
299 views

Postgres row_to_json precision for numeric type

I am using the row_to_json function to convert a table row to a json object. There are a few columns in the table that are of type numeric which contain float values. When row_to_json returns the ...
0
votes
0answers
47 views

MySQL 5.1.73 Tuning for PHP5.6 Application [on hold]

I have a PHP5.6 application running Symfony 2.x, backed by MySQL 5.1.73. We are currently experiencing latency in our data tier during peak load. During normal operation we see about 2k queries per ...
0
votes
1answer
19 views

How to fetch the string from the column of table in postgresql?

I have the following table Userid District_code 1 05 1 03 2 03 2 04 3 06 and want to get this output: userid=1 dist_code(05,03)
0
votes
1answer
342 views

count record according to month for all user need mysql query

I have 2 tables: user id username 1 a 2 b transaction id user_id transaction_date 1 1 2016-02-02 11:23:02 2 1 2016-03-02 11:23:02 3 2 2016-02-02 11:23:02 I want ...
0
votes
1answer
16 views

Errors in the OLAP storage engine: A duplicate attribute key has been found when processing

When I try to process my cube and specifically the Employee_DIM, I get the following error : Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: '...
0
votes
0answers
7 views

How to create a data history in a dimension without using slowly changing dimension?

I'm working on my fact table and I want to create history table for each dimension without using slowly changing dimension because my data flows are bulky and it will take too much time to finish the ...
5
votes
3answers
818 views

Do I need full recovery mode when I have multiple daily backup?

I have created 5 maintenance plans on my SQL server (say 50 !) which generate databse backup 5 times daily. As I read in this Q/A the full recovery is good when I need Point-in-time recovery. My ...
-1
votes
0answers
10 views

Installing Postgresql ODBC driver in AIX box [duplicate]

I am installing postgresql ODBC driver in AIX 7.1 box. PsqlODBC driver - psqlodbc-10.03.0000 After installing the psqlODBC driver, we will be connecting to our database postgresql 10.6 which is ...
2
votes
2answers
7k views

Inserting empty string on Windows MySQL doesn't use default value

Why inserting '' on a column with default integer value on MYSQL/WINDOWS produces ERROR 1366 (HY000): Incorrect integer value: '' for column 'id' at row 1 The query is: insert into test2 (id,test) ...
0
votes
3answers
32 views

Sum of decimal values that come in a string

Is there an easy way to get the sum of all decimal values in a string column. Example: "ABC $3.25, DEF $2.50, HIJ2 $0.25" "ABC1 $3.25, DEF $2.50, HIJ $0.25, KLM $4.50" I want to add only the values ...
4
votes
1answer
274 views

SQL Server OR operator causing massive loop join

The query below is very slow (running over a minute) and I have narrowed down the issue to the OR operator (...OR (EXISTS (SELECT...). I used live execution to verify that there is a nested loop join ...
0
votes
0answers
9 views

mysql 8 innodb clustering - adding instance fails with error “Unknown database 'mysql_innodb_cluster_metadata'”

I'm setting up my first mysql innodb cluster, following the instructions here: https://dev.mysql.com/doc/refman/8.0/en/mysql-innodb-cluster-production-deployment.html I've configured the instances ...
0
votes
1answer
12 views

How to store token in postgresql?

I have a column in table with type character varying here is the query: update logins set access_token='l38r8cfjm31b38ye91yjn1956vr3n74tc5sc0btholj0iain77' and uuid='123456789' where username = '...
0
votes
0answers
19 views

Mysql 8.0 table_rows problem

I'm doing an application and I have the following problem: I'm doing a LOAD DATA INFILE into a table from a txt file, that has 2 million rows. I want to see the table_rows of my table with: SELECT ...
0
votes
1answer
43 views

SQL: Comparing multiple dates

I got a table with multiple columns that contain DateTime namely gendate1 up to gendate8. In my stored procedure, the user will have to input a date (@date_start). Now I have to compare the inputted ...
1
vote
1answer
700 views

Force replication to statement for INSERT to a table to fire trigger on slave

We have a PROD DB which replicates into a slave DB using mixed replication. We want to add a trigger so that a row is added to our DW when a row is INSERTed into table_a (on master). The issue is that ...
1
vote
0answers
29 views

postgres boolean function and check constraint

I been using postgres for a while. Mostly simple stuff. Now trying to implement a small perl function to check for a single valid email address. My employees table should have either a single valid ...
0
votes
1answer
88 views

MS Access - Creating a report based on a pass-through query that requires a parameter

I am attempting to make a report in Access that uses parameters as well as a pass-through query. I'm open to using a temporary table but the guides I can find using temporary tables all use an ...
1
vote
1answer
102 views

mysql 8.0, updates are sometimes stalling

Recently I moved one of my production servers from MySQL 5.7 to 8.0. Immediately after that I noticed that update statements are sometimes (not always) taking more time (enormously) and tend to stack ...
3
votes
3answers
143 views

why it is doing index seek

I created a sample table as below CREATE TABLE [dbo].[StatisticsDemo]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NULL ) ON [PRIMARY] Then I inserted below data as below: ...
0
votes
1answer
261 views

SSRS 2008 to 2014 Migration Excel Export error

We are working on migrating our SSRS from SQL Server 2008 to SQL Server 2014. After brining the reports over I have a set of reports that will execute just fine but when I try to perform a standard ...
4
votes
1answer
55 views

Execute Permissions for a Store Procedure that creates databases

I have a Stored Procedure that creates a Database for a specific project which needs to run every month by one of our Data Analysts. The question is how do I structure this to enable the Analyst to ...
0
votes
0answers
22 views

psql: FATAL: the database system is starting up

I'm running into this message but not able to make heads or tails out of why it's throwing this: -bash-4.2$ /usr/pgsql-10/bin/postgres -D /data/patroni --config-file=/data/patroni/postgresql.conf ...
1
vote
1answer
308 views

my ssh is ok but masterha_check_ssh is fail

my environment is vmware12 + centos6.6 + mysql5.5 + mha4mysql-manager-0.53-0.noarch.rpm + mha4mysql-node-0.53-0.noarch.rpm my structure is one master three slaves master 192.168.233.135 node ...
0
votes
0answers
9 views

How to sync easily between a master database from Google Cloud SQL and a master database from Amazon RDS

I've created a master - slave (replication) in Google Cloud SQL. I've also created a master - slave (replication) in Amazon RDS. I want to sync two master MysQL from Google Cloud SQL and Amazon RDS....
0
votes
0answers
16 views

Cannot connect securely to enterprise manager

I'm working on my classwork and had a problem with connecting to the enterprise manager. After running the DBCA the address given to me was https://10.0.2.15:5500/em, pulling it up on IE I get cannot ...
0
votes
1answer
421 views

powershell command enable-alwayson not work for SQL Server Named instance

Hi all, I installed a SQL server 2016 default instance and a SQL Server 2017 named instance (instance name is SQL17) on my Windows 2012 Server. I opened a powershell windows with administrator mode, ...
1
vote
2answers
51 views

Query to see Index Fragmentation on all databases without using SP or temp tables

I am trying to compile a index fragmentation report on all databases, in a multi-server environment. The query will be executed via an openquery command, so I would like to make it as simple as ...
0
votes
2answers
353 views

Unique key constraint violation not escalated to parent stored procedure

I have a stored procedure which calls 2 nested sub procedures. For Example, MyProc BEGIN BEGIN TRY BEGIN TRAN EXEC UpdateProc EXEC InsertProc COMMIT TRAN END TRY ...

15 30 50 per page