0
votes
1answer
357 views

Tracking the update or changes in mysql table

I need to stream the changes to elasticsearch to keep in sync with my database(mysql). What will be best way to do this ? I have thought for below approaches Using trigger( but my table will have ...
0
votes
2answers
144 views

SQL Query Help to get Quiz statistics

I'm coding a quiz web application and i need help. I've got three tables Nicknames : |USER_ID|NICKNAME| that stores USER_ID(auto increment) and NICKNAME registered to my system. Questions : |...
0
votes
0answers
12 views

How to Delete rows based on a combination of columns having a certain count

I'm having trouble writing a query for the table below. CREATE TABLE `c_example` ( `id` int(11) NOT NULL AUTO_INCREMENT, `c_id` int(11) DEFAULT NULL, `guid` varchar(32) DEFAULT NULL, `...
0
votes
2answers
869 views

How to build a table for a private messaging system that supports replies?

I'm writing a private messaging web application in PHP, the application allows replies such that when you view a message, you also get to see to what was that a reply to, and to what was that a reply ...
0
votes
1answer
23 views

What is effective way to delete duplicate records based on multiple columns in MySQL?

I have a table named users having approx 70 Million records, out of which I guess 10 Million is duplicate. How to remove those 10 Million records keeping one copy of that. Two records are said ...
0
votes
1answer
13 views

How to migrate windows login in from one sql server to another sql server on another domain

We have a SQL server that is located in domain 1(DMN1). We are migrating databases in domain 1 to our new SQL Server in domain 2(DMN2).Corporate states that there will be no trust established between ...
1
vote
1answer
183 views

Sync MySQL database and Quickbooks Database

I use Quickbooks as an accounting software. I also have a MySQL database where I record data on orders, customers, inventory, employees and etc. Is there a way for me to sync the two databases? For ...
2
votes
2answers
32 views

Using TOP in INSERT INTO statement

I am reading a tutorial about TOP Keyword in T-SQL. But I don't really understand the examples given in the tutorial. Example1 INSERT TOP n INTO table_name1 (Col1, Col2) SELECT Col3, Col4 FROM ...
-1
votes
0answers
5 views

Tlog restore keeps failing, now states “restoring”, normally completes after restoring last file, this time no luck, any thoughts?

I am hoping you can help me out!! Our restore keeps failing with the error message: Message Executed as user: NT AUTHORITY\SYSTEM. ALTER DATABASE is not permitted while a database is in the Restoring ...
0
votes
0answers
8 views

Retain column statistics on paragraph-style columns?

Specific to Microsoft SQL Server... If a query has a search predicate against a paragraph-style text column, it will create a system-created statistic to answer the query. Got it. My question is if ...
0
votes
1answer
215 views

Sessionizing Log Data Using SQL window functions: tweaking a query (incrementing session ID and event length)

I'm referencing to a very good blog entry, that describes how to sessionize log data with SQL window functions. I'm no database pro and I don't really understand the logic behind this query (you can ...
4
votes
0answers
62 views

Optimizing “WHERE x BETWEEN a AND b GROUP BY y” query

CREATE TABLE test_table ( id uuid NOT NULL, "RefId" uuid NOT NULL, "timestampCol" timestamp without time zone NOT NULL, "bigint1" bigint NOT NULL, "bigint2" bigint NOT NULL, "int1" integer ...
0
votes
1answer
12 views

Securely manage and dynamically create multiple databases

Background I have inherited a system that has several hundred databases. The primary "Clients" Database represents all clients with several tables like: WebUsers = username | password | server_id ...
1
vote
4answers
112 views

How can I allow part of a key to be null and enforce uniqueness of records with nulls?

I have an Access table called Engagement with four fields: Emp_id, Year, Week, Act_id It records when an employee is/was engaged in an activity. Each field is Number and each makes up part of the ...
0
votes
2answers
385 views

custom product variant upload

I'm building a custom eCommerce solution for a client. I came up with this database design: +---------------+ +---------------+ | PRODUCTS |-----< SKUS | +---------------+ +--...
0
votes
0answers
5 views

Accept remote TCP/IP request from aLL IPs in SQL server

I have problem with access to SQL server with TCP/IP. I would like to SQL instance accept client from all network adapter that machine has. I go to configuration manager console and enable TCP/IP, ...
0
votes
0answers
3 views

MDX measure to DAX conversion

I needed a little help on working with MDX and DAX. Recently I have just started working with these two terms and am having a little trouble figuring out the differences and possible examples of how ...
1
vote
3answers
764 views

Fastest way to do bulk import in MYSQL

I have got a question about the fastest way to copy a large number of records (around 10 million) from 1 table to another in MySQL. The target table has 1 primary key, 4 indexes and 3 foreign key ...
3
votes
6answers
314 views
+50

Database design for an exam

I am designing database for an exam, and I am stuck. I do not know how to do it. Here is the relevant information: Student answers 10 questions. Each question has 3 options (answers) and student ...
9
votes
4answers
914 views

SSMS Registered Servers with ReadOnly Application Intent

We are working on SQL Server 2014 POC testing with AlwaysOn and one of the user asked about saving the configuration of SSMS with ReadOnly Intent using the registered servers in Local server group. ...
5
votes
2answers
52 views
+250

MySQL Innodb_row_lock_current_waits is 2^64 - 1

I have a MySQL 5.6 server which we monitor using Nagios. Over the weekend, it's started complaining about the Innodb_row_lock_current_waits, which currently has a value of 18446744073709551615, yes, ...
4
votes
2answers
65 views

SQL Server- Limit to Concurrent table queries?

In SQL Server, or RDBMS systems in general, is there a limit to the number of concurrent queries that can be made against a table? How is it that N number of users can access the same physical data ...
1
vote
2answers
533 views

Vague replication error code 2005

2015-04-07 13:49:53 23758 [ERROR] Slave I/O: error connecting to master 'replication'@master-host:3306' - retry-time: 60 retries: 1, Error_code: 2005 This was after attempting to do a change master ...
1
vote
1answer
28 views

MySQL Temporary Tables

I am facing Memory issue in our server. While debugging I came to know that, many number (millions) of temporary tables are created. Is there any way to identify which databases are creating this ...
1
vote
1answer
30 views

Can SQL Server R Services be enabled on a readable secondary?

To avoid excess load on the primary SQL Server, I'd like to install and enable R Services on a secondary replica of the primary server. Is this possible? Also, can I push computations from a remote R ...
1
vote
1answer
50 views

MySQL – BLObs Hitting Performance

One of my tables contains seven BLObs. Six of these refer to raw data and are typically 1.0 – 1.5Mb each. The seventh is the result of processing this data and can be nearly equal in size to the sum ...
1
vote
1answer
51 views

Questions and answers database design for Core Data

I am designing database for a question and answer projects , and I am stuck. I do not know how to do it. Here is information: There will be many users There will be many questions Each question ...
0
votes
1answer
16 views

Where clause returns null, but need to return 0

Need an SQL Statement for the following: Table a partID partNumber Table b partID purchased SELECT a.partNumber FROM a WHERE (SELECT SUM(b.purchased) WHERE b.partID=a.partID) > 0 If ...
0
votes
2answers
20 views

Grant permissions to a user to grant select to specific tables in several schemas in Oracle

I administer a small datawarehouse in Oracle. My user dwhmanager was given the SELECT ANY TABLE privilege: GRANT SELECT ANY TABLE TO dwhmanager WITH ADMIN OPTION; The idea was to have the ability to ...
4
votes
3answers
241 views

In SQL Server, is there a way to determine the values of the parameters passed to an executing stored procedure

One way to determine the executing stored procedure is to use "dynamic management" methods, like so: SELECT sqlText.Text, req.* FROM sys.dm_exec_requests req OUTER APPLY sys....
4
votes
1answer
2k views

MySQL - run SELECT statement on another server without defining the table structure

In MySQL I can query information on another server using federated tables, as long as I've defined the same table structure locally. In MS SQL Server, however, I can run any SQL statement against a ...
0
votes
0answers
16 views

AOAGs status in HTML Format to Mail

Can you please help me formatting the script.I am using html format and trying to send to my mail but I am not getting output to mail but I can send output as attachment and can you please help me ...
0
votes
1answer
18 views

Extracting Company from Multi-tenant Shared Schema Database

We have a mutli-tenant shared schema database architecture. As a form of load distribution we have spread the tenants/companies across 6 SQL 2014 servers and 20 databases. All DBs are virtually the ...
1
vote
2answers
28 views

Why is table opened every time a query is executed against it?

I execute this SQL command twice and profile select * from sbtest.sbtest2 limit 100; The first time profile result is mysql> show profile for query 1; +----------------------+----------+ | ...
0
votes
1answer
24 views

Find Missing Dates in My table

I have a make table that figures daily pride and assigns the current date to each line. I want to be able to run a query to pull all pride numbers from 06/01/2016 to 06/30/2016 and then run a query ...
3
votes
2answers
119 views

SQLite Like clause match whole word only

I have a SQLite database with a table named: minecraft +----+----------------------+ | id | name | +----+----------------------+ | 1 | Pocket Mine MP | | 2 | Open Computers ...
3
votes
2answers
3k views

mysqldump doesn't restore database. why not?

Why doesn't my restore operation work? I created a dumpfile for a database using: mysqldump -u root -p databasename > /home/databasename_bkup.sql I then opened the dumfile and confirmed ...
1
vote
1answer
16 views

MYSQL TABLESPACE = innodb_file_per_table GIVING ERROR 1030 (HY000): Got error 168 from storage engine

I have tried this statement to place a tables in different disks. Operating system is Linux Oracle 7, I've changed permissions in the directory with chmod -vR 777, to have total access to the disk ...
0
votes
1answer
24 views

How to use a table when the user identifier can be one of two fields

Recently we've started developing Github like organisation system for our service. We have both free and payed plans. There are users. Also there should be the owner for organisation and the owner ...
0
votes
0answers
22 views

SQL Server 2012 failover cluster node won't start cluster services

We have 2 node SQL server failover cluster setup in our environment. Node2 SQL server machine got shut down. I turned it back on and connect back to the failover cluster. It successfuly connected ...
0
votes
0answers
19 views

Cannot delete Postgresql constraints that were former unique keys

I have modified unique constraints. I am adding a field to every unique constraint. To do that, I need to drop the existing unique constraints and create the new ones. I am trying to delete foreign ...
0
votes
0answers
17 views

Oracle DB refresh on 11g using 10g Cold backup

I am a sql dba, I am having only a little knowledge on Oracle. looking for help regarding oracle db restore. I am having an Oracle 10g cold backup, i need to restore this on Oracle 11g setup, can you ...
3
votes
3answers
4k views

Problem with new MySQL Workbench connection

I'm working on Debian 8 and wanted to create database using MySQL Workbench. I did everything in this tutorial, but when I created a new MySQL Connection, the program returned: Failed to Connect ...
1
vote
1answer
113 views

postgresql 9.1 failed insert occupies increasing disk space

I have a postgresql 9.1 installation where the available disk space is very low (20Gb) however there is only one client that inserts data in various tables (typically one entry every few minutes) and ...
1
vote
1answer
28 views

Management Studio 2016

Its strange problem with my SSMS 2016. With in the query window backspace , del, up,down,left,right keys nothing works. But when I reset my environment settings with "Import and Export Settings" to ...
1
vote
1answer
18 views

Why does the scipt executes only once the sqlscript

the following script is pretty simple, but it works not as expected. I searched for an answer but I am stuck. #!/bin/bash db_con=user/pw@db bname='filename' for f in $(seq 1 10); do sqlplus -S ...
3
votes
2answers
37 views

Insert if something changed other than specific column

I have a table with many columns but my snippet is simplified. I have the trigger shown below but how can I have it so that nothing is inserted if only the created_at column has changed? ALTER ...
1
vote
0answers
14 views

Trying to restore SQL file from mysqldump, results in syntax error

I ran the following sqldump call in a MySQL 5.7 instance (Windows OS): mysqldump --skip-lock-tables --single-transaction --flush-logs --hex-blob --master-data=1 --routines -A > ~/dump.sql I ...
9
votes
1answer
553 views

CouchDB and document versioning

I'm currently working on a wiki-esque application using CouchDB and am trying to implement a document versioning scheme. The way I see it there are two ways of doing this: Store each version as a ...
-4
votes
0answers
28 views

How to calculate the difference in values between two tables

There are two tables T1 and T2, T1 contains the current values, in case the user Needs to update/correct the values. The concerned row from T1 moves to T2 and a new tuple is added to the T1 with ...

15 30 50 per page