9
votes
1answer
512 views

Why does 10^37 / 1 throw an arithmetic overflow error?

Continuing my recent trend of playing with large numbers, I recently boiled an error I was running into down to the following code: DECLARE @big_number DECIMAL(38,0) = '1' + REPLICATE(0, 37); PRINT ...
1
vote
3answers
113 views

Is there such thing as automatic ENUMs?

There are some tables that I manage which contain a string value (for example, a 4 word "Type" field). There are only a few DISTINCT strings, however the application may insert new strings that have ...
1
vote
3answers
410 views

shoud we normalize user profile table with fields like interests,musics,videos,sports, etc?

I've read in an article about social networking database schema and saw that they've used varchar for those columns that I mentioned in the question title. It's not normalized! Isn't it better to have ...
1
vote
1answer
61 views

Matching a smaller piece of text in a local variable to a larger piece of text that I have pulled in a query

I think this is a simple question, but google searching for 30 minutes was mostly wasted time as all I can find is matching a variable to a 'randompieceoftext'. Anyways, suppose I have a local ...
1
vote
2answers
113 views

Wordpress- changing all subscriber passwords query [closed]

I'm trying to mass change (120) subscriber passwords. The passwords are stored in table wp_users but I need to change the password based on information from another table wp_usermeta where it has ...
1
vote
1answer
514 views

replication warning: transactional replication latency alert not working

I have set up a predefined replication alert (as outlined here) in SQL Server 2008 and the alert for Replication Warning: Transactional replication latency does not appear to work. This is triggered ...
3
votes
1answer
734 views

Update rank on a large table

I have a mysql table that has now 12 million records and I'm trying to update a column (rank) with the following UPDATE code: SET @r=0; UPDATE records SET rank= @r:= (@r+1) where type = 2 ORDER BY ...
1
vote
1answer
218 views

SQL 2005 Replication - How do I get the DA Profile MaxBCP option to work with a Transactional Publication?

I have two publications on a database. One is a transactional publication, the other is a snapshot publication. We have a stand-alone Distributor (separate from the publisher) and both publications ...
3
votes
2answers
290 views

Why ALL PRIVILEGES ON `db`.* gives access to all databases?

I've installed Ubuntu 12.10(quantal) and mysql-server-5.5. When I execute: drop user ''@'localhost'; create database `redmine`; grant all on `redmine`.* to 'redmine'@'localhost'; User ...
1
vote
2answers
867 views

Remote to a remote oracle server and get running instances?

I need to make a shell script that takes a list of servers and and check the running instances then run sql script in each instance! now I do not want it to ask me for a password! it's redhat and ...
2
votes
1answer
586 views

Cannot CAST '33.33' to INT

I have encountered a problem where the WHERE clause is causing a problem. The varcharColumn is of datatype VARCHAR and contains numbers as well as text. The query looks to be averaging this column, ...
1
vote
0answers
24 views

JBoss/Alfresco cannot write on slave after failover [duplicate]

Possible Duplicate: JBoss don't fail over MySQL slave using datasource I'm trying to set up an high available MySQL "cluster", using a Master / Slave Replication configuration. I want ...
1
vote
1answer
683 views

how to run limit query within condition in mysql

I have a huge database around ~20,000,000, presently I am running a php script, which verifies if user info is 'valid or invalid'. There are several entries named 'invalid' in the database. Problem is ...
2
votes
2answers
2k views

How to improve MySQL Server Performance..??

As a MySQL DBA most of the times we are supposed to optimize a poorly performing MySQL Servers. Now my question is where to start from like we will need to find out many things as 1.Find the ...
10
votes
1answer
418 views

Disable explicit commits in JDBC, detect them in SQL, or put the database in a readonly state

Background: I'm working on http://sqlfiddle.com (my site), and am trying to prevent one avenue of abuse possible there. I'm hoping that by asking about a problem I'm currently addressing, I don't ...
2
votes
1answer
744 views

Replicating Triggers

I am doing some analysis on merge replication and triggers for a project. I have two tables, Product and Audit that I am replicating. I have an update trigger on the Product table which is ...
6
votes
2answers
201 views

How to script database validations?

I want to create a smart way to execute a SQL script when rolling out DB changes into QA, UAT and production environments in order to smoke test database changes are correct after maintenance has been ...
5
votes
1answer
450 views

Why is the page life expectancy 0 (zero) on SQL Server 2005

We have been wanting to know the page life expectancy for our SQL Server. So we look at the counter using Perform. The value is ZERO and never changes. I thought there must be some bug, so I checked ...
2
votes
2answers
673 views

Query intermittently fails with “The multi-part identifier could not be bound”

I've got Schrodinger's query here; you can run it once successfully, then 5 times in a row, and it works fine. Change anything in the query, even whitespace, run it again, and it might stop working ...
1
vote
0answers
243 views

SQL Server 2008 R2 DeadLock on query Notification

for the first time, I'm running into a deadlock on ...The deadlock graph doesn't help me much except the fact the query notification system seems to responsible. <resource-list> ...
5
votes
4answers
273 views

Database Design for updatable sequential records

I am working on creating a data model for storing data related to production tracking. I work for an engineering firm that models and analyzes data for our clients. There are several steps in the ...
2
votes
1answer
87 views

MySQL Unions/Subselects not utilizing keys from associated tables

I've noticed by doing EXPLAINs that when a MySQL union between two tables is used, mysql creates a temporary table, but the temp table does not use keys, so queries are slowed considerably. Here is ...
1
vote
1answer
370 views

How do I handle importing high amounts of transaction data into application DB?

For the moment, this is a hypothetical question. I've got a database that has a high level of transactional data coming into it. I also have a database that supports my website (my application ...
2
votes
2answers
949 views

Find the largest databases on my server

I have several hundred databases running on the same MySQL server. How can I get a list sorted by the size of the databases?
0
votes
2answers
232 views

Tools for Identifying Needed Indexes

I want to create the best indexes for each table in my database. Is there a query or tool in SQL Server to help with this process?
2
votes
1answer
437 views

Resource Usage Statistics by Login

Is there a way to get resource usage statistics by login in SQL Server? Ideally, I'd like to have a version of sys.dm_exec_sessions that tracks usage for all sessions, rather than just the ...
4
votes
3answers
831 views

Some book suggestions for performance tuning

I am in the process of improving performance on our database application. While I am not a DBA, I am pretty comfortable with SQL. I am after a book that can help me understand how queries written in ...
2
votes
1answer
94 views

Create a Function in sql server without specifying return_data_type

I am trying to create a Scalar-valued function in SQL server, without specifying the return_data_type i want to be able to return any datatype based on a parameter sent by the function caller e.g. ...
2
votes
1answer
2k views

JBoss don't fail over MySQL slave using datasource

I'm trying to set up an high available MySQL cluster, using a Master / Slave configuration. I want to the slave become master (e.g. not read-only but writeable) if the first node come down (like in ...
-1
votes
1answer
76 views

Index Proposals

As a theoretical database question, if you are asked 'which indexes would you propose and why?' are the answers from primary, clustering and secondary index? How would we know if we should introduce ...
2
votes
1answer
265 views

Calculate number for each row

My table structure is below: CREATE TABLE [ACC].[Document]( [DocumentID] [int] IDENTITY(1,1) NOT NULL, [Date] [date] NOT NULL, [SalesCompanyFinancialPeriodID] [int] NOT NULL, ...
0
votes
1answer
5k views

open files limit

I am getting "too many open files" error when I try to insert records in a partitioned table. mysql> insert into test.ox_data_geo_span select * from vserv.ox_data_geo_span limit 100; ERROR 1016 ...
2
votes
1answer
365 views

Any problem with same conversation handle used by multiple services communicating with one target queue in a multiplexed service broker order queue?

I asked a question about implementing conversation groups in a SQL Service Broker setup which has several User Services communicating with the Server Service (Processing xml data requests to be sent ...
2
votes
1answer
82 views

How should I use indexes with MySQL?

Can someone give me a brief intro to indexes? My questions: Why would I want to use indexes? How I should use them? It looks like I can create multiple indexes on a single table - what is that for? ...
-3
votes
1answer
2k views

How can I get my LEFT OUTER JOIN to work in SQL Server 2008?

I trying to create a table with this school data in it? Year Month Days Referrals 2012 1 16 10 2012 2 20 7 2012 3 15 11 Year, Month and Count of Days from one ...
1
vote
1answer
42 views

Get wall_post and profile data for several users

I'm trying to build a query for fetch wall_posts and profile fields for several user_id. First see the images at: http://www.dropmocks.com/mBjQ7P. The table with id_user_rq, id_user_ap is the table ...
3
votes
1answer
349 views

Limiting database security

A number of texts signify that the most important aspects offered by a DBMS are availability, integrity and secrecy. As part of a homework assignment I have been tasked with mentioning attacks which ...
2
votes
4answers
594 views

simple question about group by and custom groups

Imagine a MySQL table that only has 2 columns: an id and a name of a color. With this query, I know how many id's I have for each color: SELECT color_name, count(id) FROM color_table GROUP BY ...
2
votes
1answer
1k views

What are the differences between Cognos and SPSS modeler products?

My school wants to start doing some data mining, and probably go with an IBM product. I've done a fair amount of searching, but the differences between the two products seem cloudy to those of us who ...
3
votes
2answers
500 views

can I add a custom SSRS e-mail subscription that forces the “TO” address

I would like to know if it is possible to add a custom delivery extension(?) in SSRS that will enable me to force a value into the "TO" address for particular subscriptions? Big picture: I am ...
1
vote
1answer
307 views

Slony initial subscription is causing out-of-memory kernel panics. Why?

Context: We run Slony 2.0 with Postgres 8.4 on two CentOS 6 servers--one master, and one slave. Our database is about 30GB in size, which isn't unusual, but we do have a couple of tables that are ...
3
votes
1answer
2k views

Filtering on a virtual column from a UNION ALL with LEFT OUTER join causes a table scan?

I asked this question on SO but havn't got many bites and even a vote to close for being "Off Topic." So, I thought this stack exchange might be better suited. Consider the following SQL... SELECT ...
1
vote
2answers
707 views

Convert datetime stored as char the YYYMMDDHHmmSS format to datetime

I'm working with a table where the date and time of an event is stored as a char in the format YYYMMDDHHmmSS or '20120606122012'. I need to compare this to the current timestamp to see if it's been ...
3
votes
1answer
211 views

Best mysql db design to solve timezone issues

I faced problem with timezone on my last two projects. So What is best way to sort out problems with timezone on db design. I mean, What format should i added date time stamp. On of my problem. My ...
2
votes
1answer
438 views

“set-variable = innodb_thread_concurrency=4” or “innodb_thread_concurrency=4”

Based on this question, the asker wrote: set-variable = innodb_buffer_pool_size=2M set-variable = innodb_additional_mem_pool_size=500K set-variable = innodb_log_buffer_size=500K set-variable = ...
5
votes
1answer
496 views

Release SQL Server Memory usage

How can release memory usage of sql server by command. my system have 16GB RAM, but when get huge query by sql server, memory usage become full. if I restart SQL Server service memory usage become ...
3
votes
1answer
442 views

Service Broker Procedure that will be used by multiple initiators to begin dialog conversation.. how to pass a parameter into it

The standard format for beginning a dialog is like this: Declare @dialog_handle UNIQUEIDENTIFIER BEGIN DIALOG CONVERSATION @dialog_handle FROM SERVICE initiator_1 TO SERVICE 'target_1' ON ...
3
votes
2answers
4k views

How to get last identity row Inserted when using instead of trigger

When I inserted on tables that exists instead of triggers on those. @@Identity , IDENT_CURRENT('Table') and SCOPE_IDENTITY() return null. How I can get last identity of inserted row
1
vote
1answer
411 views

How to sync a table between oracle and sybase

I have a table in Sybase (destination) that I would like to keep it synced with a table in Oracle (source) I cannot truncate and populate the table in Sybase because it is used by an application, I ...
2
votes
2answers
118 views

Ways to stop access to a SQL express database

I have a SQL express database and was wondering what options I have for securing it? More specifically it is a replicated database using merge replication. I want to stop a user with a replicated ...

15 30 50 per page