0
votes
2answers
31 views

why the optimizer doesn't choose the optimal plan [on hold]

I know, if the statistic is not updatad, it is possible, that the optimizer doesn't choose the optimal execution plan? Does any other reason/reasons exist?
0
votes
0answers
16 views

How to move a specific Postgres database to different harddrive?

I have my postgres db running on harddrive d:\, and also all the tables are placed there by default. Now I want a specific table to be save to a different drive (say f:\). The table is not yet ...
1
vote
1answer
14 views

missing WAL file on standby server following a backup

I seem to have an intermittent problem with my postgres backup/restore to standby Postgres, is version 9.2 running on red hat 6 enterprise i have a production server (PROD1) and a hot standby ...
0
votes
1answer
37 views

Add row after every rows of a table from select statement

There are two tables. I want to add every record of one table under every record of the other table. The two tables and the result table are shown below. TABLE_1 TABLE_2 TABLE_3 TYPE ...
1
vote
0answers
9 views

MySQL performance of trigger when many rows are affected

I have a question on MySQL triggers which I hope someone might be able to help with. As part of our platform, we have a table (accounting), which grows rapidly. We also have an archived version of ...
2
votes
2answers
299 views

Getting all databases which a sql logon can connect

I need to know all databases in a SQL Server on which a user can connect. With sys.databases I get all databases and with sys.server_principals or sys.syslogins I get all server logons. But I can't ...
2
votes
0answers
13 views

Method to Obtain LossLess Join BCNF Decomposition

I have been told a way to obtain loss less join BCNF but I don't know how to calculate candidate keys(also called super key in some cases) and trivial Dependency. I have been given a relation R = ...
-1
votes
0answers
24 views

Generating new empty values while retrieving data from a database [on hold]

I have a Pettycash table Like this: PettycashId LedgerName OppositeLedgerName amount While I retrieving data like this: Select PettycashId,Ledgername,OppositeLedgername,Amount from Pettycash ...
1
vote
0answers
38 views

Getting count of visits for multiple different outlets

I'm trying to get the distinct count of id that visited different outlets. I have more than 50 outlets so I don't think I can use the IN operator. CREATE TABLE transact ( year int NOT NULL, card_id ...
1
vote
1answer
29 views

Advantage of exposing data model to customers using our product

We have a product through which we provide a standard definition to customer's asset data. The problem currently lies in importing customer's data from different types of data sources to our data ...
0
votes
0answers
37 views

PostgreSQL: Best way to INSERT for vertical search engine [on hold]

I'm trying to develop vertical search engine running on PostgreSQL & Go in Linux server. Data harvesting using Linux command line. For the INSERT query: The "best" I means is safe & high ...
0
votes
1answer
9 views

How to enable queries logs in MariaDB

I'm running mysql Ver 15.1 Distrib 5.5.42-MariaDB, for Linux (x86_64) using readline 5.1 in CentOS 6.6 server. I'm trying to get queries logging info and I'm doing by enabling log support at ...
0
votes
1answer
31 views

How to select a column to compare two values in it with AND [on hold]

How to select a column to compare two values in it with AND select distinct c.reg#, a.fname, a.lname, to_char(b.L#) as "L" from employee a, driver b, trip c where a.e#=b.e# and b.l#=c.l# and ...
1
vote
2answers
18 views

Receiving the following error in step failure of an agent job:

SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x00040EDA Description: "Warning: Null value is ...
1
vote
0answers
12 views

How do I modify a stored procedure in IBM DB2?

I have a DB2 database and I'm using Control Center. I've found a procedure in the 'Stored Procedures' folder, which I need to modify. In MS SQL Server and Oracle you can accomplish this right from the ...
0
votes
2answers
9 views

MariaDB/InnoDB: What to do on “Locks in Status-Log but no locked table found”

We migrated lately from MySQL to MariaDB. SELECT VERSION() 10.0.13-MariaDB-log When executing this: SHOW ENGINE INNODB STATUS I get (shortened): ... ---TRANSACTION 279257007, ACTIVE 23981 ...
1
vote
1answer
21 views

SSMS down arrow on last line

I apologize if this is not the correct place to ask this but something is bugging me. I could have swore that at a previous job I could be on the last line of code in SSMS and hit the down arrow and ...
0
votes
0answers
11 views

Query DML code to determine source and target data

I looking to scan all of the procedures in our database in order to save off source and target table information for our data loads. I'm thinking there should be some sort of dba table which will give ...
0
votes
1answer
14 views

Strategy for regularly updating datasets from excel files

I have ~10 excel files which are produced by a third party and updated each night. I've have a script that downloads them to my local machine. They contain ~ 10 fields (all short text / dates) and ...
1
vote
0answers
20 views

Create Nested XML in a Sql Server Indexed (Materialized) View

This page https://msdn.microsoft.com/en-us/library/ms188276.aspx indicates that if you wanted nested XML (ie an XML Tree) then you need to setup your query like this: SELECT Col1, Col2, ...
0
votes
1answer
12 views

Analyse and report disk usage growth historically

Is it possible to use historic information to show disk usage growth? I haven't keep much in the way of database setup and disk usage information. So I can't say how much disk growth has occurred in ...
-2
votes
0answers
32 views

Repair SQl server 2000 [on hold]

I need to Repair SQL Server 2000 by means of repairing it and not installing it or uninstalling it. Is there a way of repairing the system files without them being removed?
1
vote
1answer
21 views

Shortcut for deleting a line of SQL

Is there a shortcut to delete your current line of SQL without highlighting the full line? I want to delete the line that my cursor is on without selecting the whole line. So in visual studio CTRL + ...
0
votes
1answer
16 views

How to select data out of an Oracle collection/array?

Due to needing some complex data manipulation and not being able to use PHP, I crafted a procedure (not stored, it's just run when we run the query) in Oracle to manipulate the data and store it in an ...
0
votes
1answer
26 views

How to join tables without identifiers?

For school I have to do this: Query what salary scale an employee belongs to displaying these collumns: s_schaal.schaal, werknemer.name, werknemer.salaris. But there are no identifiers between the ...
0
votes
1answer
14 views

can't create foreign key in sqlite

I'm trying to run this code in sqlite: sqlite> CREATE TABLE test(id integer primary key AUTOINCREMENT, page varchar(10), dp_record_id integer, foreign key (webserver_id) REFERENCES ...
0
votes
1answer
13 views

How does one create a Matrix Report to convert sql columns as rows? [duplicate]

I'm trying to create a product listing. Naturally Sql prints the data vertically forming rows after rows like this: Rowa. product_img#1|Product_name|Product_price|Product_short_description Rowb. ...
1
vote
1answer
36 views

Another Dynamically alias column question

I might be asking the same question as this, but perhaps if I ask it my way, a different solution may become obvious. I have this: DECLARE @Table1 AS TABLE( Table1ID Int Primary Key ,ColumnName ...
2
votes
2answers
198 views

Half of a transaction completes, when the other half fails?

I have done some searching on SO, MSDN, and various other sources, and I found plenty of questions about transactions, but none that seem to be exactly what I'm dealing with. Admittedly I'm still ...
0
votes
1answer
11 views

Switching a partition on a table with one to many relation

There is two main tables in database (SQL Server 2014) table1: ---------------------------------------------- id name datetime image table2: -------------------------------- ...
2
votes
0answers
60 views

Why is this MySQL query “using where” instead of “using index”?

Could you help me with this query, please? SELECT p.patid, MAX(c1.eventdate) as eventdate from patient as p left join op_adv_effects._clinical as c1 on p.patid = c1.patid left join ...
1
vote
1answer
20 views

MySQL Brute Force Defense

I was wondering what defense MySQL server uses to protect against brute force attacks on the user credentials? I hope this isn't too simple of a question! I have tried to Google it, but can't seem to ...
1
vote
0answers
25 views

Can I populate a table in mysql without ending up with duplicated entries [migrated]

I have a database. However whenever I am trying to add products to the cart table from a shopping page, I realize that the same item is added multiple times to the table if the add button for that ...
-2
votes
0answers
28 views

How can we restore shipped transaction log files in SQL Server 2012 to an online (being used) database without stopping the DB? [on hold]

How can we restore shipped transaction log files in SQL Server 2012 to an online (being used) database without stopping the DB? Is there any way to copy data from an online database to another online ...
0
votes
1answer
26 views

SQL Service Broker and AlwaysOn Issue

I'm having an issue setting up my current environment using AlwaysOn and SSB and I'll try to explain as best as I can here: Current environment: Server A Server B database x(Pub) ...
1
vote
1answer
26 views

Is it possible for a client to kill a long-running Postgres query?

A client makes a request to a Postgres database for data. The database is too slow to respond. Is it possible for the client to send a CANCEL request or something to tell Postgres to stop working on ...
2
votes
0answers
12 views

MS SQL Parsing with XPath Performance

I have a UI that allows a user to select certain data points they want to filter the results by. There are things such as location, department etc. Once they have selected all of the options, I ...
1
vote
0answers
8 views

Does the consistency part of the CAP theorem apply to updates and not first-time writes?

Using this definition of the CAP theorem: Consistency All database clients see the same data, even with concurrent updates. Availability All database clients are able to access some version ...
2
votes
2answers
22 views

MySQL - SELECT on MyISAM Table on index - Does table size (rowcount) matter?

I was arguing with a coworker if SELECT * WHERE t BETWEEN ? AND ? on a MyIsam table where t is an index is significantly slower for huge tables. The hypothetically returned dataset is always the ...
1
vote
0answers
21 views

How do I cast a varchar to Bigint in DB2

I have a field which is varchar(25) and I need to create a join between that field and a field that is a bigint So I guess I need to convert the field into bigint aswell but it's giving me some ...
1
vote
0answers
15 views

Dynamic Paramterized Replication to a PUSH subscription

I have a publication that I want to filter by suser_sname() filter. This works perfectly fine when I'm using a pull subscription. However, I need to use a push. How do reflect this suser_sname() as ...
1
vote
1answer
120 views

Dropping person while their connection sleeping in SQL Server

I have a C# application that communicates with SQL Server. When I try to drop a user that recently had a connection with SQL Server, it gives me an error that I can't delete them because they have ...
1
vote
1answer
34 views

SSIS Packages get stuck in SQL Agent jobs [on hold]

We run about a dozen scheduled SQL Agent jobs which run SSIS packages. Intermittently, every scheduled job will get stuck in a running state. i.e. we'll arrive in the morning and notice that there's ...
0
votes
1answer
27 views

Speed up procedure

I was wondering if this procedure can be executed faster. There are indexes on the joins and where's. Depeding on the size of product_id_CSV it takes approx. 2.5 sec. CREATE ...
1
vote
1answer
27 views

Is it possible to restore a MySql database only using files from Data directory?

I have a mysql installed inside a windows virtual machine. The hard drive was crashed and the system is not able to restore all again. But I can have access to entire c: ROOT. So I went to ...
1
vote
1answer
41 views

SSRS Blocking Processes

We have a busy SSRS Reporting server (SQL Server 2008 R2) on which we see frequent blocking between the below processes: [dbo].[CheckSessionLock] [dbo].[WriteLockSession] We are aware that some ...
1
vote
2answers
153 views

Join two tables and return data and count in a single query

I have two tables in an SQL Server database, one with two columns and one with four: tbl_email_list email_list_id int (PK) email_list_name varchar tbl_email-details email_uniq_id int (PK) ...
0
votes
2answers
45 views

Write a query to create skill table. Please note that the field description can be NULL and the default value is NULL [on hold]

I wrote this query for this question. but it does not work create table skill ( id bigint(20), description varchar(255)DEFAULT NULL, name varchar(255), primary key(id) );
-1
votes
0answers
29 views

How can I install Oracle 11g on my laptop? [on hold]

I am a student and I am taking an introduction to database module this semester. The module requires us to work with the university's Oracle database server. Whenever I'm not in campus, I would VPN ...
1
vote
1answer
5 views

mysql dump import incredibly slow on my developer's machine

I have an SQL dump, it's pretty big (411 MB) and it took 10 minutes to import on server A, the same import on my workstation B has an estimate (pipeviewer) of 8 hours to import (it imported 31 MB in ...

15 30 50 per page