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
60 views

Database Mail not sending

I'm trying to send email using the DatabaseMail on SQL Server 2008, I can see my emails sitting in the msdb.dbo.sysmail_unsentitems But they just sit there, I get no error messages. I've checked ...
1
vote
0answers
50 views

Join and aggregate result and insert blanks for missing appendants

Consider these two simplified tables: CREATE TABLE "sources" ( "id" serial NOT NULL, "name" text NOT NULL, CONSTRAINT "sources_pkey" PRIMARY KEY ("id") ); CREATE TABLE "values" ( ...
1
vote
0answers
40 views

Testing equivalence in strings with different character sets

I have to synchronize a number of tables with string columns between two databases: the source Oracle 10.2.0.3 NLS_CHARACTERSET WE8MSWIN1252, NLS_LENGTH_SEMANTICS BYTE the destination Oracle ...
1
vote
0answers
43 views

Failover cluster connection issue

I'm trying to run SQL Server Failover cluster in Azure. I have NODE1 and NODE2 in a cluster and another SERVER in the same network trying to connect to the database server using the instance from ...
1
vote
0answers
54 views

appending 2 tables based on common columns in Postgresql 9.3

I have 2 large tables that I need to combine into a single table--for statistical analysis. The two tables have some variations in column named, otherwise I would just use an INSERT statement. So I ...
1
vote
0answers
31 views

Transactions using Isolation Level on databases with FileStream

We have a highly transactional application. We have a requirment to upload huge data into our database that can happen for a duration of 5-10 minutes. During our upload time, the tables are getting ...
1
vote
0answers
24 views

What to do when the error message is longer than 4000 in T-SQL?

I have a OPENQUERY linking to an Oracle server that is failing. (I can't make any changes on the oracle server) But when it returns the error string it is cut short because it returns the query in ...
1
vote
0answers
43 views

Getting upcoming world wide releases from a database

From my database I want to get upcoming world wide release dates for an itemId along with the platformIds. If I have a table that looks like this and the current date is 2014-05-14 ...
1
vote
0answers
100 views

Storing changes to stored procedure and triggers in PostgreSQL

I want a mechanism where I can store/track changes in stored procedure and triggers. I want to track these logs in some table. What is the best possible way ?
1
vote
0answers
138 views

Best practice - SQL Schema to store Timerecords for a Time and Attendance module

I'm starting a time and attendance module in C# and SQL. There will be many time rules depending on every shift. For example: Shift 7:00 - 14:00 for Administratives: 15 min grace time, but if ...
1
vote
0answers
43 views

Multiple login mappings for linked server

Can we assign two logins for two different databases on target server. For example, I would like to create a Linked Server between ServerA and ServerB. ServerB has two databases on it and both using ...
1
vote
0answers
56 views

SELECT, PROJECT, CARTESIAN PRODUCT and JOIN

I have the following tables; DOG +----------------------------------------------+ | Name Type Age Kennel_name Owner_name | +----------------------------------------------+ ...
1
vote
0answers
81 views

Phantom insert query

I have a log table which I have to clean up a bit because it is growing very fast. While deleting some historical data I reached count zero for that condition on which I have deleted the entries. 5 ...
1
vote
0answers
37 views

ODBC Connection Not Refreshing

I am trying to connect FedEx Shipping Manager Integration Assistant to a SQL 2008 R2 database. I have a view created that has all the necessary fields to populate in the Integration Assistant. The ...
1
vote
0answers
53 views

Tagged questions

I have similar to StackExchange network that utilises tagged questions. In my web application Users also can find questions by tags. The query below returns a set of tagged questions: SELECT ...
1
vote
0answers
70 views

Efficient way to Add NON-CLUSTERED Index?

I have the following table, CREATE TABLE [dbo].[Products]( [ID] [int] IDENTITY(1,1) NOT NULL, [RetailerID] [int] NOT NULL, [Name] [nvarchar](255) NOT NULL, [Price] [float] NULL, ...
1
vote
0answers
35 views

Will installing WebMatrix (and Consequently SQL Server CE) Break My Current Installation of SQL Server 2005?

We have a server that has (and needs to keep) SQL Server 2005. We are hosting intranet sites on one server (server 1), but have a database on another server (server 2). One of these sites uses AJAX ...
1
vote
0answers
31 views

Upgrading the SQL Server version

My SQL Server version at home is 661 and at my school's is 655, so every time I try to open my web's SQL Server database at school it says there is an error: So I thought that uploading the SQL ...
1
vote
0answers
164 views

SQL command in stored procedure continue on error

To perform Checkdb on all database of server i am using a stored procedure which loops over a view which contains list of databases in server and the stored procedure performs checkdb on all databases ...
1
vote
0answers
56 views

WMI event alerts

I am trying to understand WMI event alerts and have implemented a mirror with alerts on DATABASE_MIRRORING_STATE_CHANGE such that all database failover if the state is either 7 or 8 (manual failover ...
1
vote
0answers
170 views

Postgres database zero down time production deployment

I need some idea about how I can deploy a financial application in production environment using PostgreSQL DB with zero down time. I have two servers in Master-Slave design. Currently I am giving ...
1
vote
0answers
41 views

Find repeating tickets with more than one criteria

Lets say I have 2 tables: atms & tickets each atm has many tickets. ATM table: ID | NAME ------------------------- A0109 | ATM 1 A0227 | ATM 2 etc. | etc. Ticket table: ID | ATM | ...
1
vote
0answers
70 views

How to join the tables in mysql to get wall messages and comments with name of person ? Only user and his friends messages

I have four tables in my mysql database as shown in the image url provided. I want to select data from the tables without duplication. I want to show messages and comments on wall according to the ...
1
vote
0answers
116 views

Can not ping Always On listener from outside primary node

I just setup SQL Server 2012 (on Windows Server 2012) Always On feature and have a problem with connecting to SQL Server Listener from non-primary node (it works from primary node though). Here is ...
1
vote
0answers
94 views

MySQL aggregation count performance

I have a table with about 30 million records, and I'm doing a query where I can group by field Year and count the results for that year. The table structure looks like: id | year | amount The ...
1
vote
0answers
124 views

Missing rows in MyISAM tables with 10-20 billion records

I've got 2 tables with 10-20 billion records each. Currently these are in MyISAM (MySQL). They only require to be built and indexed once, after this only SELECT is used. They are currently ...
1
vote
0answers
25 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
51 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
55 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
254 views

Removing Secondary Replica from SQL Availability Group Causs Large Log File

Due to an unforeseen hardware error, I had to take our secondary replicas down for maintenance. This was really due to a storage issue and, it was decided at a higher level, to purchase a new storage ...
1
vote
0answers
104 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
72 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
54 views

Too Many Backup Devices Specified while restoring

I have similar problem like this one http://www.sqlcoffee.com/Troubleshooting023.htm But the issue is i have setup of sql sever 2005 now i am installing same on the client's pc so the main issues is ...
1
vote
0answers
225 views

SQL Server 2008R2 Merge Replication Identity Range Exceptions for Data Imports

Bottom line question: How can I insert data into subscriber tables that are governed by identity range management, where the data has valid identity values that fall outside of the current range? ...
1
vote
0answers
79 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
2k 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
25 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
85 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
80 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
91 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
132 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
139 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
125 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
50 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
313 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
248 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
205 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
212 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 ...