All Questions

5
votes
1answer
184 views

Generic TVP tradeoffs?

Is there a best practice or strategy for table types used in TVPs? For instance, given the following: CREATE TABLE dbo.Colors ( Id int identity PRIMARY KEY, Name nvarchar(100), ); CREATE ...
1
vote
1answer
34 views

MongoDB - Mongorestore is not working as expected

A Very Good Day, I have the user in the mongodb like below who has the superuser privileges (I confirmed the role setting using show users command) { "_id" : "admin.mongoadmin", "user" : "...
0
votes
0answers
15 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 ...
-1
votes
0answers
40 views

MySQL Missing Closing Parenthesis

I have DDL below to create a Speech Table, however, there is an error missing 'closing parenthesis'. When I tried to run, the foreign keys of the Speech table, i.e. (Presenter, Job_ID, Post_Date) were ...
0
votes
2answers
20 views

How to set all auto increments to 1 in a Schema

Is it possible to reset all auto increment in a schema in one query? if not even just by per table will do. btw I am using MySQL server 8 thanks in advance :)
0
votes
0answers
18 views

Is there a possibility to run 2 minor Postgres version in parallel (Postgres 10.x)?

I have Postgres db instance 10.6 running in production say node-b: rhel 7.6 while I am building another cluster (not instance) of 2 nodes. Out of these 2 nodes one posgres node will reside on this ...
3
votes
1answer
104 views

T-SQL LIKE Predicate failed to match with whitespace in XML converted varchar

Recently I attempt to search for a particular pattern by converting XML data into varchar(max) although I'm aware it's not the best practice and found out it's not working as expected:- Setup ...
2
votes
1answer
202 views

Fragmentation Level for Heaps

I am currently using scripts provided by Mr. Ola Hallengren for executing maintenance job and of-late I have been noticing that there are many tables (heaps) fragmentation level is alarmingly high and ...
0
votes
3answers
44 views

How to grant user to dbms_crypto ?? Oracle (User which created inside SYSTEM)

Couldn't find user I tried this grant execute on sys.dbms_crypto to "DB_Project"; But error: ORA-00942: table or view does not exist 00942. 00000 - "table or view does not exist" Also tried this:...
0
votes
0answers
35 views

MySQL how to GROUP SUM based on JOIN TABLE

I have Three Table, One Master Table and Other Two Table have relation with it. Below is the Three Table: 1. ball_by_ball table, this table holds full information by ball by ball: CREATE TABLE `...
1
vote
1answer
15 views

MongoDB Too many open file while reSync member

I get the problem in many past days. I have MongoDB cluster with 3 shards and 3 replicas. 1 2 3 A O S S B S P S C P O P P - Primary state S - Secoundary state O - Other ...
-1
votes
0answers
40 views

One query with multiple JOINs vs multiple queries [on hold]

I am working on Posrgres 9.6 with PostGIS 2.3, hosted on AWS RDS. I'm trying to optimize some geo-radius queries for data that comes from different tables. I'm considering two approaches: single ...
1
vote
2answers
35 views

Double FOREIGN KEY, i.e. how to create a table with two different FOREIGN KEYs that reference a single PRIMARY KEY in another table - DDL

I have an issue with my SQL syntax when creating a table with a set of Foreign Key (Orig_Dept_ID & New_Dept_ID) that references Dept_ID in the Department Table. Below is my sql syntax: CREATE ...
0
votes
0answers
23 views

Increasing working memory in Postgres does not improve query performance

I am very new to database administration and could use any advice from more expert users of PostgreSQL My database is an AWS RDS db.m4.large whose specification are here My queries against one of ...
0
votes
1answer
19 views

Optimize query plan when your results are either a few rows or hundreds of rows?

The most frequent query typically uses a variable that has hundreds of rows, but also runs often with a variable that has only a few rows (it's always one or the other, nothing in between). SQL ...
0
votes
1answer
11 views

duplicate entries from mysql LIKE query

with this sample dataset I have this query SELECT products.id, products.title AS product_title, products.code, products....
0
votes
1answer
55 views

Loading Data from CSV file or Staging Table to Multiple tables - SQL Server 2014

Hi i am trying to load data from CSV file to multiple sql server tables and some of the tables having Reference to parent tables so i can get the FK column value but trying to load via INSERT INTO ...
1
vote
1answer
50 views

Optimizing read query in PostgreSQL

I'm having a tough time optimizing a read query from PostgreSQL 10. The query is as follows SELECT mp.id_person, ( COUNT(CASE WHEN mp.id_g_type = mc.id_g_type (and mc.g1 ...
0
votes
1answer
44 views

Is it possible to log ship from on-premise SQL server to Azure SQL Managed Instance?

From the docs, it would seem that restoring a full database backup file is possible, but can one also restore transaction logs? (the idea is to minimize downtime in a migration from on-prem to MI). ...
3
votes
0answers
30 views

Database Encryption scan for database <name> was aborted. Reissue ALTER DB to resume the scan

I disabled TDE on a database and once completed I dropped the DB certificate for it. Later I performed a manual failover to node2 and ran steps to enable TDE once again. However encryption state is ...
0
votes
1answer
23 views

Postgres 10 and malformatted array literal when using EXECUTE

I am trying to create a function on Postgres 10 that would check whether all the given ids exist in the target table. CREATE OR REPLACE FUNCTION "public"."has_mismatching_ids"( _ids TEXT[], ...
0
votes
0answers
6 views

How can I complete a full export and import of Google BigTable

!/bin/bash BigTable_ExportTest.sh Edited original source script with new bucket and jar file. This script will backup BigTable Data Table by table and store it into a destination location as ...
0
votes
0answers
16 views

Understanding non repeatable read anomaly in databases

This paper discusses in detail ANSI isolation levels discussed in ANSI SQL standard on page 84. Paper introduces following shorthand for describing histories which contain reads, writes, commits and ...
0
votes
1answer
18 views

how to show a specific value for a non existing value in second table in join?

I have 2 tables, City(city_id, city_name) and count_staff_in_city(city_id, count_staff). the first table keeps the name of the city and its id, and the second table keeps the number of staffs working ...
0
votes
0answers
10 views

Symfony Quiz Entity Design

Dear Helpful SE Users, In my quest to get more experience of Symfony I thought I'd write a quiz website which I can use at school (I know that moodle does this but it is a bit overkill for my ...
0
votes
0answers
24 views

init_connect not executing

From this question I was able to make my init_connect = "CALL mydb.Warnings()", but a user login in does not triggers the SP. the SP is like: CREATE DEFINER=`root`@`localhost` PROCEDURE `Warnings`...
1
vote
2answers
18 views

Default phpMyAdmin Login Credentials

I downloaded and installed phpMyAdmin 4.8.5 on my windows. Upon opening it in the browser, it immediately asks for a Username and Password. I tried to submit root for username while leaving the ...
0
votes
1answer
13 views

How to use 'mysql -uroot -pXXXX' on Debain 9.8?

My apologies for this lame question. Debian 9.8 changed some things and mysql is broke but I can't seem to fix it. I installed MySQL on Debian 9.8, which now installs MariaDB 10.1. After install I ...
0
votes
1answer
14 views

Import database Mysql structure Only

I have a huge dump.sql Mysql database of about 3GB that has the structure and the data
0
votes
1answer
29 views

Duplicate primary key

I am new in database and ms access.I am developing a database of income tax return form submitted by several taxpayers. Where each tax payer has an unique ID called ETIN (electronic taxpayer ...
1
vote
1answer
15 views

MySQL RDS - Unable to Kill Hung Queries

I have a MySQL RDS instance that's got 100+ queries all stuck waiting for a table metadata lock. The good news I have permission to kill all of the sessions, and have 0 concern for data loss as this ...
0
votes
1answer
34 views

Multiple Availability Groups on one instance

I want to add second availability groups to Always on group and I need to change the port to 5023 but it is read-only as shown below: The first availability group has an endpoint which is listening ...
0
votes
1answer
33 views

executing SQL query with temp tables using 1.6jdk

I created a batch to run a query that has temp tables as the below example IF OBJECT_ID ('tempdb..#TEMP1') IS NOT NULL DROP TABLE #TEMP1 select * into #TEMP1 from cutomer IF OBJECT_ID ('tempdb..#...
1
vote
3answers
41 views

Is there a more concise way in Postgres to extract a portion of a string?

I'm using Postgres 9.5. I have a table with a column that records URLs. Sometimes the URL has a query string and sometimes it does not. I would like to extract the URL, minus any query string, so I ...
0
votes
0answers
7 views

Use data from Mysql to ElasticSearch with Logstash

I'm using logstash for use my mysql database in ElasticSearch My conf is the next. input { jdbc { jdbc_connection_string => "jdbc:mysql://[ip]:3306/nextline_dev" jdbc_user =&...
0
votes
1answer
53 views

Any way to represent simple AND/OR business logic in a database?

I'm designing an application to provide students access to modules once they have completed certain online courses. I have tables for: Students, Modules, Courses, and StudentCourseResults. Course ...
0
votes
0answers
17 views

Unknown column “X” in field list on delete, but the column exists

I'm using MySQL and i'm trying to run a delete statement as follows: DELETE FROM `myTable` WHERE `nincidusua` = 84 and the following error occurs: Unknown column 'nincidusua' in 'field list' My ...
0
votes
2answers
27 views

For states (col) receiving exactly X number of items (row), sort the items by weight (col)

I have been trying to figure this out for a few hours now but haven't gotten it. Each row in the table is a package. I am able to get the States with the exact number of packages, but don't know how ...
0
votes
0answers
8 views

Postgis KNN in Postgres 9.5

I'm trying to use the Postgis KNN functionality as described here: https://postgis.net/docs/geometry_distance_knn.html I have one table with all point geometries. The table has many samples, and in ...
1
vote
1answer
36 views

Why Output is wrong after doing the left join as subquery

I have TWO QUERY which work perfect, but when i join those two query as LEFT JOIN the output become wrong. So what is the problem.? Query 1: select Batsman.innings_no, bowler, sum(...
0
votes
0answers
15 views

Joining multiple (10+) tables IN CASE attribute exists, min 1, max all

I've asked a version of the question here Allow Null Columns vs separate 1-to-many tables and here Multiple JOINs of possible properties in a 'flower' arrangement - acceptable design? but ...
0
votes
0answers
25 views

Strange behavior changing type off column

I'm changing the column type of a table from timestamp without timezone to timestamp with timezone and something strange is happening. For some unknown reason, when i run the alter table statement: ...
0
votes
1answer
30 views

Error when running SQL Server 2014 64-bit Import/Export Wizard

I have previously asked this question on Stack Overflow, but I am not sure if it should be migrated to DBA Stack Exchange. https://stackoverflow.com/questions/55186094/error-when-running-sql-server-...
2
votes
1answer
61 views

Does using a read committed isolation level and a NOLOCK query hint impact performance?

Can having both the SET TRANSACTION ISOLATION LEVEL READ COMMITTED and WITH (NOLOCK) on all tables in SP cause conflicts and downgrade performance on the SP? I just noticed some changes that a dev ...
0
votes
0answers
38 views

SQL Server 2016: Run xp_cmdshell as a different sysadmin user aside from the SQL Server service account

I been trying to research this for hours and can't seem to find anything. Basically what I am trying to do is run a xp_cmdshell command as a currently signed in sysadmin user To give some background, ...
1
vote
1answer
29 views

Is there way to get transaction commit timestamp in Postgres?

I have data-pulling functionality that once in 5 seconds grabs all the data from Postgres table basing on modified_timestamp column. It works the following way: SELECT * FROM my_table WHERE ...
0
votes
0answers
22 views

How to use AS OF TIMESTAMP or DBMS_FLASHBACK.ENABLE_AT_TIME across multiple schemas

We have a requirement to read data as of certain time (say T1) from, say, schema 1, fill some staging tables in schema 2 with that data. And then read data from some other tables of schema 1 as of T1 ...
0
votes
1answer
16 views

Access denied for user 'root'@'localhost' What proces is causing this?

I got this connections constantly in logs, how to trace what app is trying to connect? root@localhost is allowed to connect and working for some apps. I think there is some app without changed ...
0
votes
0answers
22 views

How do I set up a query for Google sheets? [on hold]

I've got a sheet which contains the results of a google form. Column A contains a timestamp, B an ID, and C an integer value. Time,ID,Value 3/16/2019 x:xx.xx,0001,x 3/16/2019 x:xx.xx,0001,y I want ...
0
votes
1answer
12 views

Can't create any objects within OLAP database

Problem I can't create any objects under my databases in my Analysis Server. My context menus on all the folders under this test database just have Refresh as an option. Details My Analysis Server ...

15 30 50 per page