1
vote
1answer
22 views

ERROR 1091 (42000): Can't DROP 'PRIMARY'; on “mysql_upgrade”

I updated MySQL from 5.5.50 to 5.6.31 on a Centos 6.8 box with Plesk 12.5.30. Using those steps. The upgrade was successful but I ran into trouble with mysql_upgrade. I had to rebuild the permission ...
0
votes
1answer
24 views

Joining columns with null values into one row [on hold]

I used a sub select to get the data I want. I'm struggling to merge it all into one row now though. This is an example of the result where its bike but there are loads on them: bike bike ...
1
vote
0answers
12 views

Add Shapefile loader plugin to PgAdminPortable

I'm using PgAdminPortable and I'd like to enable « PostGIS Shapefile and DBF loader » plugin. The issue is that the files are not structured as in a PostgreSQL complete install (see below). I have ...
1
vote
0answers
6 views

.DBC (FoxPro DBF) > FoxPro ODBC Driver > MIDDLEWARE > SaaS

I've been searching for Visual FoxPro ODBC Driver and finally found it. I am using a middleware to connect a .DBC (foxpro) > MIDDLEWARE > SaaS. I see from postings on MSDN that Microsoft suggests ...
1
vote
1answer
27 views

Change all varchar date formats with a single query

|date(varchar) | |--------------| |2016-02-16 | | -------------| |03-12-2015 | |--------------| |07-07-2007 | |--------------| |2016-03-14 | Dates are stored in different formats and ...
0
votes
1answer
24 views

Linkserver update not working in Transaction

I am trying to do operation on my linked server. I have created one linked server and everything is ok. I just observed one thing which I am not able to understand. if I run: update SERVER.testdb.[...
-5
votes
0answers
49 views

Is it possible to take MS SQL Server 2012 backup in particular date range? [on hold]

Is it possible to take MS SQL Server 2012 backup in particular date range?
0
votes
0answers
17 views

single Small Table with more rows or single large table with less rows [on hold]

I need to design a table to hold an various records coming from the source. The records are such that they have around 20 fixed columns that are common to all. There are another 10 to 15 columns which ...
-1
votes
1answer
13 views

Copy tables from another sql server in another PC to My SQL SERVER database

i want to copy table data from one database in another pc to my local database in different pc. Can anyone help me with that. i have a different method of doing that but i need another method.i want ...
0
votes
0answers
12 views

Joining tables in Eloquent ORM based on condition to disallow duplicates

I have two tables I am looking to join data. This is a friendship table based on a recommendation I've seen on here. It's an AB BA relationship between friends. I want to join this with a profile ...
2
votes
1answer
58 views

Is it Ok to use GUID as the Foreign Key?

Here's my current situation: We have a table storing data submitted from the website form, say "MyTable". The table uses bigint (auto-increment) as the primary key. Everything is good so far. Now, ...
1
vote
1answer
31 views

How to select user that doesn't exist in the second table

I am trying to understand how to select a user from users table that is not associated with current user in user_follows table: neither in users_id not in shown_users_id. Basically a new user that ...
0
votes
0answers
10 views

read-ahead reads in 'workfile' cannot be disabled

In SQL Server, I used "DBCC TRACEON (652)" to disable read-ahead reads. However, the output of TPCH query 9 (http://www.qdpma.com/tpch/TPCH100_Query_plans.html), shows: Table 'supplier'. Scan count 9,...
0
votes
0answers
10 views

Restoring a backup of 1 database to another puts both databases into Restoring mode

We have a 2 databases- Staging Test At times, we refresh out Test environment with a copy of Staging. We do this by taking a full backup of the Staging database and restoring it over the Test ...
3
votes
0answers
19 views

Tool to automatically refactor queries, replacing subqueries with CTEs [on hold]

I have to mantain very big and complex SQL queries (more than 1000 lines) with many nested subqueries. These queries were made by other people and are very difficult to understand, so I want to ...
-3
votes
0answers
36 views

Get user rankings based on points from database [on hold]

I've created a website where members collect points to get a reward at the end of the contest. I want to create a page that shows the top 10 members who have the most points. I've tried a few pieces ...
1
vote
1answer
23 views

How to join multiple results into one row with dynamic columns?

Foreword - I don't know how to formally describe the situation in a single question so the below is as verbose as I can make it... Taking wordpress as an example, there's the "wp_users" table which ...
1
vote
1answer
36 views

What is the cardinality of entity relationship between Employee and Department?

Recently, a friend of mine asked me this question about the cardinality between a Department and Employee entities, I replied many to many, then he, my friend, showed me drawings from the internet ...
1
vote
0answers
27 views

Dynamic table name in Insert query

I have asked a question about dynamic table name in a prepared statement here , but I want to know if Mysql server support dynamic table name like this : SET @tbl = 'Dawin'; INSERT INTO @tbl (col1,...
1
vote
1answer
17 views

XML database for linux

I want to be able to store multiple xml objects in a database. But I don't want to just serialize the object and dump it out. Rather I would like to be able to access the database representation of ...
2
votes
0answers
43 views

Database design for auto-incrementing, grouped, unique hashes?

I've come up with a (hopefully) better way to save unique company data, which now consists of unique hashes for each entity. Basically, there are multiple hashes associated with a company: hash1: ABC ...
13
votes
5answers
338 views

From the DMVs, can you tell if a connection used ApplicationIntent=ReadOnly?

I have an Always On Availability Group set up, and I want to make sure my users are using ApplicationIntent=ReadOnly in their connection strings. From the SQL Server via DMVs (or Extended Events or ...
2
votes
1answer
45 views

ORA-01017: invalid username/password;logon denied

There were other similar questions asked, but none that were able to tell me why I can't connect using a C# .NET web site I've stood up. While I know this forum is more for DBAs connecting to ...
0
votes
0answers
38 views

Remove header (column names) from query result [migrated]

I am using a Java based program and I am writing a simple select query inside that program to retrieve data from the PostgreSQL database. The data come with the header which is an error for the rest ...
2
votes
1answer
24 views

MySQL table concatenation - sort of!

I have a db with the following: Name, Team, Score, Points I want to be able to do a query that returns Name, Score, Points for a particular team and another table that returns Points, Score, Name ...
1
vote
0answers
12 views

Getting Beginning Balance inventory of every month for the whole year in MYSQL

Good day, I was trying to create a report of inventory movement rate for the whole year, so I need to get the beginning total of every item in my inventory table every month... my sql table looks ...
1
vote
0answers
40 views

SQL Server 2016 DB Mail Not Sending

I'm on SQL Server 2016 and having a blast... my DB Mail isn't sending and I'm running out of places to look. I double checked the SQL account permissions to the DBmail executable - it has read and ...
1
vote
1answer
31 views

SUM() 3 columns with alias into a fourth one

This is one part of my procedure: select nome, --casos expedidos (- 3 meses) isnull((SELECT count(cod_rep) FROM tbReps where ...
2
votes
1answer
75 views

Querying True Physical Database File Sizes

On querying database file sizes... 1) Most if not all of these answers do not always match the physical file size shown in file explorer: http://stackoverflow.com/questions/5945360 The accepted ...
2
votes
1answer
62 views

Missing .msi files gives error while repairing SQL Server 2008R2

I've got a SQL Server 2008R2 SP1 database installed and I'm trying to run a repair on it using a 2008R2 install binaries. In the middle of the repair loading, the window suddenly shuts down and gives ...
4
votes
1answer
87 views

Microsoft SQL Server 2016 performance degradation for stored procedure called 1000's of times

Context : Small table, stored procedure to update table, first two thousand hits no problem. After those first hits it starts to crawl to a snails pace. This stored procedure has no problems in our ...
3
votes
1answer
26 views

Customize jsonb key sort order involving arrays

I have a table in PostgreSQL with some data: create table t2 ( key jsonb, value jsonb ); INSERT INTO t2(key, value) VALUES ('1', '"test 1"') ,('2', '"test 2"') ,('3', '"test 3"') ,('[]', '"...
2
votes
1answer
21 views

Out of range errors while with insert statements

I'm having an issue regarding every third insert line of the database I'm trying to create. Some background, I have a huge .JSON file and used software (sqlizer) to turn it into input statements, ...
0
votes
0answers
25 views

Write SQL Server query result set to Event Viewer

Is it possible to write the output of a SQL Server query as a log entry in the Event Viewer?
0
votes
0answers
13 views

SQL Server 2014 Availability Group Listener only visible to primary node of AG

I'm having some trouble configuring the Availability Group Listener for SQL Server. Here's my current setup: I have one server, lets say server DC, which acts as the domain controller for AD DS with ...
1
vote
0answers
19 views

SELECT UNION from multiple tables with same schema in MySQL

I want to SELECT (combine) records from multiple tables with the same schema. This is the query that I use: SELECT visitor_name, in_time, out_time, blacklist FROM visitor_archive_2012 UNION SELECT ...
1
vote
1answer
22 views

Documenting SSRS and SSIS jobs that are the Job Activity Monitor

We are running a SQL Server 2014 database using SSRS as a reporting tool. We have data coming in via SSIS jobs and linked servers. We have developers creating various SSRS jobs and scheduling them. ...
1
vote
0answers
59 views

The query processor ran out of stack space during query optimization. Please simplify the query

I'm using SQL Server 2014. When running this query: DELETE FROM shuser WHERE datecreated > '6/21/2016' AND FkShUserCreatedBy = 1 GO I get an error: Msg 8621, Level 17, State 1, Line 1 ...
3
votes
1answer
29 views

Postgresql tables seem duplicated (with suffixes such us pkey, hashes, etc)

due to some problems I came to check the state of my current database in production and I found that some tables are "duplicated". By duplicated I mean that there appear to be some clones of the ...
0
votes
0answers
16 views

Restore PostgreSQL database with same locale settings as source database

I have a PostreSQL 9.x database on an Ubuntu 14.04 LTS production machine. My development machine is Windows 7-based, providing PostreSQL 9.y. I want to restore the Ubuntu PostreSQL database on my ...
1
vote
1answer
57 views

SQL Server TempDB size issue

SQL Server reported that our tempdb is out of space. So I had a quick google search and found this on technet https://technet.microsoft.com/en-us/library/ms176029(v=sql.105).aspx Determining the ...
1
vote
0answers
51 views

SQL Server x64 DBCC Shrinkfile Dies not release Unused space (never ends No errors) [duplicate]

I have a 1.8TB Production database in my test environment on a 2TB drive. Currently there is only 1 .MDF and 1 .LDF (on a separate drive). The Database has had some major cleanup of unused indexes, ...
1
vote
2answers
56 views

How to select sets of data from a table

I have a table containing data that represents a tree structure of data, using the nested set model. I'd like to store data for more than one tree in the table and have only one of the sets of data ...
1
vote
0answers
7 views

How to clear gcache pages in Percona PXC

I have a 4 node cluster(percona PXC) and one of the nodes have more than 150 gcache disk files each of size ~128 MB. I would like to purge or flush them so that the server user fresh gcache disk file. ...
1
vote
1answer
55 views

Aggregation using CASE

I have a table called country: CountryName | Sales A 200 B 100 C 300 D 500 E 400 Now I in my report I have hardcoded the parameter of ...
1
vote
1answer
26 views

Sync two mysql database one in intranet and the other on internet

I'm making the training and placement module for my college. But I'm facing problems to sync the databases, one that will be used by the students and the other that will be used by the HR of a company....
3
votes
1answer
104 views

Sorting Order by GETSORTED

In my sybase 12, when I look at the showplan of a select distinct query, I see GETSORTED in the showplan's output. I've searched through the entire internet (YES!) and I can not seem to find a link ...
0
votes
0answers
13 views

Create new .SQL archive from RAW MySql 5.6 Data Directory path for import into MariaDB

I have moved my Ubuntu 16.04 (desktop) MySql over to MariaDb for my LAMP (Drupal) projects and forgot to export one project.sql (via phpmyadmin). But I still have all the original projects MySql 5.6 ...

15 30 50 per page