An acronym for "Structured Query Language" (it's not the name of a specific DBMS product), SQL can be used in relational database management systems (RDBMS) to query, update, delete, and insert data as well as modify the structure of the database. It can also be used to manage schemas and data ...

learn more… | top users | synonyms (1)

1
vote
0answers
26 views

SQL Replication - Data not showing

Good Morning, I have recently setup SQL replication and changed some data in one of the tables on the primary table. This data however has not been replicated to the subscription server. On the ...
1
vote
0answers
54 views

SQL Server 2008 upgrade and clean

After upgrading a SQL Server 2008 instance to SQL Server 2012 (in-place upgrade), there appears to be numerous 2008 instance components (namely the 2008 SSMS in start menu, in add/remove programs ...
1
vote
0answers
65 views

How to merge rows based on how much data they have?

I am cleaning data and I formed a table something like this: file | product | color | product_id --------------------------------------------- one.csv pipe blue null ...
1
vote
0answers
143 views

SQL Error 3183 On SQL Server 2012

I have a backup of database version sql server 2008 R2 . while restoring it to SQL Server 2012 I am getting error msg 3183 RESTORE detected an error on page (6100:1886858449) in database ... . ...
1
vote
0answers
80 views

MySQL: What criteria should I base my table column order/arrangement/grouping on?

Does the order, arrangement or grouping of columns with large (such as long text descriptions) and small (such as bit and tinyint) field types have any noticeable impact on MySQL (InnoDB engine) ...
1
vote
0answers
95 views

find total money of parent node of tree according to a particular pattern

actually i am working on a project in which members are added in a tree pattern, and get the payment accordingly. My tbltestingtree structure is ass follow: Id ParentId IsLeft ...
1
vote
0answers
3k views

How to speed up query on table with millions of rows

The Issue: I'm working on a big table that consists about 37mln rows. Data include measurements of many devices made in certain time e.g. '2013-09-24 10:45:50'. Each day all of those devices are ...
1
vote
0answers
26 views

Optionally free-form reference

I've seen a few instances of entities which have a field which can be either a reference to another entity or free text. You typically represent this in the UI by having a dropdown widget which can ...
1
vote
0answers
116 views

Getting distinct list of records based on the MAX of a column

I have a status table (tblTestActionStatus) which has three columns ID_TestAction: references some test action ID_Status: a look up table reference for the variety of possible statuses for the ...
1
vote
0answers
88 views

How to index for a group by with columns from different tables?

Is it possible to create an index from columns of 2 different tables? If not, how do we optimize a query that does a group by on columns of 2 different tables? For example: the following ...
1
vote
0answers
95 views

MySQL Replication fails - commands received in wrong order?

The other day, I had this issue with one of our MySQL 5.1.60 master and 5.1.61 slave setups: Last_Error: Error 'Can't create table 'foobar.#sql-4b87_2' (errno: 150)' on query. Default database: ...
1
vote
0answers
160 views

How to store object with property of generic type in DB

In my business domain there exists an entity parameter. Beside other properties which are identical for each parameter, they have values. These values can be of different data types. There might be ...
1
vote
0answers
185 views

SET IDENTITY_INSERT equivalent in Access

In sql server i can explicitly insert value to a identity column of a table by using SET IDENTITY_INSERT ON . For an Access database i am using Autonumber column datatype. For this column i am not ...
1
vote
0answers
47 views

A pre-existing hierarchial table as relational

Currently the database contains something like so (these are the main fields but there's a large amount more): +----------+----------------+----------+ | Agency | parent | main_term ...
1
vote
0answers
140 views

Producing an outstanding fees report in MySQL

This question is about a MySQL stored procedure to select the records from two tables by joining them and also do some arithmetic operations in that. I have 3 tables for fees one is to store fee ...
1
vote
0answers
53 views

Rows do not match Subscriber and Publisher

I have an transactional replication setup with updateable subscription that is utilized by an Application. When I insert a project into the application, the msrepl_tran_version is different on the ...
1
vote
0answers
368 views

Creating view recursive query in Oracle DB results in ORA-00600 (ORA-600)

Hello Ladies and Gents, I've been trying to deploy a recursive query as a view in Oracle XE and Standard Edition, neither to much success. The query is located in this question here: ...
1
vote
0answers
300 views

Search for string in xml column

I am using sql server 2008 r2 express. I have a table with column name 'xmlmycolumn' which is of datatype xml. I want to search for string in that whole xml. So to do this i am casting column as ...
1
vote
0answers
45 views

What is a good way to Merge 2 range sets into a single view

The real purpose of this has to do with effectivity dates and contains additional keys and fields, but I simplified it for the sake of, well, simplicity. Sample: test_Widget Table theFirst ...
1
vote
0answers
244 views

Search for multiple keywords related to separate columns on a single table

Imagine I have a table with the schema shown. Each of the columns represent a searchable collection that I would like to be picked up in the search. I am looking for a method that would derive the ...
1
vote
0answers
253 views

Database Timeout Error from VB Application

Recently we are receiving so many database timeout error from different servers we are using vb application -- which will use ODBC connection to connect database - here no problem when we run the ...
1
vote
0answers
102 views

Why is this query creating 300+ temporary tables in Mysql?

SHOW global STATUS LIKE '%tmp%'; set @UID = 132; set @param2 = 'cde'; set @param3 = 20130331; set @param4 = 'C'; select p.id, p.column44, p.column42, ue.column35, u.id, p.column43, p.column45, ...
1
vote
0answers
2k views

Achieve PostgreSQL hstore functionality in MySQL

Please suggest any MySQL 5.5+ Engine that can support collection of key-value pairs be stored in any column of a table. I don't know if this feature is available out of the box in MySQL like ...
1
vote
0answers
453 views

Collect CPU, reads and writes when replaying SQL Profiler Trace

I'm trying to replay a trace on a test environment with SQL Profiler in order to benchmark a database prior to making some performance tweaks. I intend to replay the same trace at various stages to ...
1
vote
0answers
56 views

Will Startup Procs Run Again After Database Recovery?

We have a number of stored procedures that run on startup via the sp_procoption startup: exec sp_procoption 'ProcName', 'startup, 'true' A customer's server started up with a very large database in ...
1
vote
0answers
461 views

Efficiently retrieve big amount of data based on date range

Table EVENTS TimeStamp |O.Name |Location |Source | 2008-11-12 |Pretorian|Európe |England | 2009-12-24 |Lex Rosa |Európe |Italy | 2010-01-01 |Nasdaq |USA |Whasington | ...
1
vote
0answers
173 views

Calculate lower and upper quartile of SQLiteDB via query

I want to calculate the upper and the lower quartile of the value what I call "diffs" in these fiddle with my DB and the query How can I do this with SQLite? There's an extension on the ...
1
vote
0answers
1k views

sql agent job hangs without any errors or warnings

Problem: we have a SQL Agent job which runs everyday in the morning at 4:00 am. This job hangs sometimes without providing any errors or warnings. It just hangs. BUT when i stop the job and run again ...
1
vote
0answers
61 views

Oracle update query sequence of actions on DB side

I searched online but could not find particularly consolidated source of what happens when you execute an update query. I know that there are a few actions happening like create redo data and logs ...
1
vote
0answers
264 views

big mysql database optimization

My Joomla mysql database has about 3.4 million rows in content table. It is just static article. Very slow and often use out of resources. To speed up it, I segmented it into 6 sub-tables and added ...
1
vote
0answers
82 views

Mysql: Large Query with subqueries optimization

Any query optimization gurus in the house?? Anyway, I am trying to attack this on two fronts, one being to code a way around it but secondly, I'm thinking some real optimization might help in the ...
1
vote
0answers
128 views

Pass in dynamic value to Oracle job scheduler

How does one pass a dynamic value into the oracle job scheduler when the underlying command is a stored procedure? example procedure: create procedure foo (bar varchar2) ... Job creation in ...
1
vote
0answers
167 views

Multi-Table Join to Single Destination

I am having a serious performance issue with join together four tables and placing the results (in a certain permutation) into one destination table. I am using MSSQL 2008 and good ole T-SQL. To ...
1
vote
0answers
483 views

How can one reliably update a LOB column with data from another LOB column in Oracle?

I have tried: UPDATE "SCHEMA".TABLE SET LOB_COLUMN = (SELECT LOB_COLUMN FROM "SCHEMA".TABLE) I have tried: CREATE OR REPLACE PROCEDURE COPY_LOB_DATA IS OLD_BLOB BLOB; NEW_BLOB BLOB; ...
1
vote
0answers
130 views

Use of hash functions in group by?

I'd use a listagg() to generate a list of components a certain customer has and compare it to another list generated the same way somewhere else to detect inconsistencies. The problem is that ...
1
vote
0answers
138 views

hStmt/cursor error caused by faulty data?

Could a busy hStmt and invalid cursor errors be caused by faulty data? ODBC and the software that connects to the database is correct and working - i have ran a test with a clean database (that has ...
1
vote
0answers
171 views

Get all comment.message, status.message, users.* and profiles.* where users.user_id exists in friend.friend_id or friend.user_id

I need some help building this query because it's a bit complicated at least for me. I need to get all comment.message, status.message, users.* and profiles.* where users.user_id exists in ...
1
vote
0answers
37 views

How does MySQL 5.1 use indexes?

I've read the docs for MySQL v5.1.x on how about the indexes are used, but I'm not sure I understood it properly. Suppose having the following MySQL table: CREATE TABLE IF NOT EXISTS ...
1
vote
0answers
941 views

SQL query optimization in Prestashop e-Commerce solution

I'm working on a layered navigation module within Prestashop e-Commerce solution. I'm trying to optimize a SQL query which creates a temp table during execution. I think this is creating a ...
1
vote
0answers
134 views

Database model problem from MS Access to SQL Server 2005

Good Day, I am a C# programmer but I have a problem with a database model on SQL Server 2005. I have a client who told me to rebuild his database from Access to SQL Server 2005 and actually I did but ...
1
vote
0answers
208 views

Cannot Check if the Access Database Engine is Installed and Configured

All, I want to check if the Access Database Engine is installed and linked to SQL Server. On my development machine (x64-bit) the following queries both show the Access Engine to be avalible as a ...
1
vote
0answers
71 views

How to write up the specs for the server that we will need

I am a dev. and have written basic app. which will be used by customers this app. Basically, I present them screen to select their excel file which has some billing info. we are analyzing this billing ...
1
vote
0answers
33 views

Monoblock, Multiblock queries?

What exactly mean the terms monoblock / multiblock queries in data warehouses when talking about materialized views? Does a monoblock query just use one data source (a normal table) while a multiblock ...
0
votes
0answers
4 views
0
votes
0answers
7 views

MySQL created_by or updated_last-by

I've been giving the task of taking SQL DDL from data modeler and to transcribe it into mySQL for an internship. The only thing I cannot figure out is how to take Created_By VARCHAR2(30) DEFAULT ...
0
votes
0answers
6 views

Simple way to migrate application SQL database into an archive database?

I'm not super technically oriented. I've used SQL for many years, but primarily operating within databases and not so much managing them in total. Anyway, we have an application we're getting rid of, ...
0
votes
0answers
18 views

Elasticsearch missing nested data

I'm trying to set up my river with nested data, however I'm facing some issues. My _river query looks like this: { "type" : "jdbc", "jdbc" : { "driver" : ...
0
votes
0answers
13 views

multi aggregated sql query functions

I have the following query: SELECT u.username, t.pack_id, COUNT( t.id ) transaction_count FROM `transaction` t INNER JOIN `user` u ON t.customer_id = u.id GROUP BY ( t.customer_id ) HAVING ...
0
votes
0answers
14 views

How to design a demographics database?

I have a bunch of stores. Each store has the same properties (ethnicity, marital status, income, and so on). Each of those properties has subproperties like (white, black, asian for ethnicity and ...
0
votes
0answers
5 views

How to split a large table in Teradata

I'm trying to load data from a very large table (200 million rows) into a Presentation Datamart (PDM) for an Enterprise Data Warehouse using Teradata 14.10. I want to split this large table into ...