2
votes
1answer
64 views

Full Text search returns duplicate keys

I have a search like the example below. The problem is that the result returns a key muliple times if the term "beach" is in myTextColumn multiple times, for example "I went to the beach because the ...
6
votes
3answers
465 views

How do I create a user for SQL Server whose queries (any/all) are time limited?

Is there any way to create a database user in SQL Server 2005 so that none of their queries are allowed to exceed a certain time limit (for e.g 20-30 seconds) or all queries are limited to a certain ...
5
votes
2answers
140 views

Unique Contraint/Index Based On Values

I have a table that has the following column definitions: ID (INT, PK) Name (VarChar) Active (Bit) Bunch_of (Other_columns) Question: I want to have a Constraint on Name/Active such that we can ...
4
votes
1answer
867 views

SQL Server job timeout

So, it seems that it is not possible to set the timeout for each single step in a SQL Server job (article from StackExchange). MSDN points out that you can of course set the Agent timeout: Sql ...
1
vote
2answers
629 views

Warnings: Why are statements with limit clause unsafe even if there isn't a limit?

I'm a bit irritated because of some warnings in mysql errorlog. Example 1: [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement ...
3
votes
2answers
717 views

More than 20 columns in database table MySQL

I have an object, that describes by 40 properties, is it good idea to create table with 40 columns? I think, that I can't break this properties into the other table (such as table_properties_1 and ...
7
votes
2answers
671 views

Merge replication fails on executing query

My merge replication was working fine this morning. Since an hour or 2 ago, my synchronisation status windows keeps showing this message: Thread id 3108 will wait for 15 second(s) before retrying the ...
2
votes
1answer
295 views

SQL SERVER 2008 TVF OR CHARINDEX to search column with comma

ID BlahColumn 1 2 2 NULL 3 2,3 4 4,5,6 5 1,2 6 1 7 1 Hello, I am using the following as part of the where clause and using charindex is not working ...
3
votes
1answer
1k views

Why does altering a table and adding a foreign key create an extra constaint?

Edit: It was a default constraint as a result of setting a default value when adding the column. The name gave it away when starting with 'DF__'. Anyway, solved it by adding the column and manually ...
1
vote
1answer
449 views

Error When Restoring Backed Up Tables

I followed directions from this page: http://serverfault.com/questions/271367/importing-data-from-myd-back-up-file I dropped the 3 files ( t2010_08.frm, t2010_08.myd, t2010_08.myi ) into my ...
2
votes
1answer
3k views

sql server management studio backup error

hello, i want a back up for my database in sql server management studio. i am using ms sql. but when i try to back up , i take the following error: =================================== Backup failed ...
0
votes
2answers
221 views

MySQL Statement not displaying some values

I have a MySQL Statement that runs perfectly but does not display some of the values from the table that it is supposed to display. My table has got a column called 'token' which has values that are ...
3
votes
2answers
1k views

SQL Server - In Recovery

Was uploading a few hundred thousand rows in my SQL 2008 R1 database and have come in this morning to an "In Recovery" message next to the database name in SQL Management Studio. I've tried a DBCC ...
1
vote
3answers
85 views

SQL Server database backups

I am looking to do regular backups of my SQL Server databases. Is there any reason why I should not just backup just the MSSQL.10/DATA folder? I've got a great backup solution in place from Rackspace ...
3
votes
1answer
105 views

What is recommended level of security for a production database?

I have a production database on our local server. Currently there are two many logins to the database, about 20, half of them are windows authenticated and the other rest are SQL Server authenticated. ...
1
vote
1answer
222 views

What is the correct way to store a list and its items in this instance?

The app I'm working on revolves around projects. Each project can contain several lists, and each list is made up of several items. Each list relates to a single project. Is it better to have one ...
4
votes
1answer
176 views

How to set constraints on UDT in SQL Server 2005 - 2012

I'm creating my UDT: CREATE TYPE [dbo].[Code] FROM VARCHAR(20) NOT NULL As RULES and DEFAULTS are considered deprecated, what is the recommended way to set constraint on my type to make sure that ...
10
votes
2answers
1k views

Why does SELECT 1/2 return 0?

As the title says. I even tried SELECT CONVERT(NUMERIC, 1/2) which also returned 0. I am using SQL Server 2008.
9
votes
3answers
216 views

Can I rely on functions being executed first in SQL

Please consider the following script: create or replace function f(p_limit in integer) return integer as begin set_global_context ('limit', p_limit); return p_limit; end; / create view v as ...
3
votes
1answer
741 views

DBLINK match a value from a local table

Am trying to run the following dblink start transaction; select dblink_connect('host=remote port=5432 dbname=remote_db user=user password=pass'); insert into local_table (column1, column2 ) select * ...
2
votes
1answer
785 views

Derby slows down after 1.2 million records

I'm using a Derby database, mass insertions slow down to 1/4 to 1/6 the speed once there are 1.2 million records (about 6 GB database size, one major table, other tables are tiny). Is that normal? Is ...
5
votes
1answer
917 views

EC2 - How to correctly back up PostgreSQL data?

Here is the setup: 1 small Amazon Linux (EBS-backed) EC2 instance with 3 additional volumes. This is both a web server and database server. One volume for code, one for the PostgreSQL (8.4) data ...
2
votes
1answer
550 views

Extract some columns data from one table and insert into multiple tables

I have a table with 16,000 records and need to get out some columns and then insert values in multiples tables. For example, suppose I have the following tables tbl_1: id, name, lastname tbl_2: id, ...
1
vote
1answer
323 views

DMZ server unable to connect through SQL Browser

I have a Web server in my DMZ, I have a SQL Server 2008 R2 server inside the LAN, this database server has named instance with a NO dynamic port. I have set as firewall rules the connection from my ...
0
votes
1answer
286 views

New transactions during a Sybase “dump database” command

I have a Sybase 15.5 database which is backed up every night using the DUMP DATABASE command. The process takes about 30 minutes. What happens to the transactions that occur within those 30 minutes? ...
3
votes
1answer
196 views

Database Relationships overview appreciated

I am helping to create a database via salesforce for storing information about Non-profit organizations. It has primarily 4 entities in the schema: Agency, Program, Project, and Contact, where Agency ...
2
votes
3answers
376 views

Refactoring Series of UNIONs in single table (SQL/SYBASE)

I am trying to query a database and reformat the rows/columns that I am interested in. Each row in the current table (EQ) represents a field in a form. In reality, there are several hundred FieldNum ...
1
vote
1answer
1k views

ORA-12541: TNS:no listener using EXPDP

I need to export an Oracle 11g database to an Oracle 10g instance. I have the command, which I believe is correct: expdp user/pass@192.168.10.8 full=Y VERSION=10.2 directory=m_dump ...
1
vote
2answers
826 views

Deleting Entries from Table not reducing my DB file

Iam usind INNODB Engine with innodb_table_per_file , so every table has it's own .ibd file instead of ibdata1 file. When i Entered 512 Record in my users table its size get increased to 200kb from 96 ...
0
votes
1answer
816 views

How To insert records in SqlExpress Database tables through sqlscript while installing setup?

I'm creating a database and all of my tables using SQL Server Express through SQL scripts. Now, I want to insert some records in tables like States (all states names), city (all city names). How ...
3
votes
1answer
64 views

Is an X lock on an “application” a bad thing?

I am digging into sys.dm_tran_locks and have found a single, persistent X lock of resource_type = APPLICATION that looks odd. The database which on which the lock exists is rarely used. The ...
1
vote
1answer
123 views

Best solution for search scenario

I have the database structure: | Tag | | Article_Tag | | Article | --------------- --------------- ----------------- id tag_id ...
1
vote
1answer
107 views

Query to change all field in a given mysql table?

I have a table with a timestamp field called "time". I have many records in this table and "time" has value like: 1343296642, 1343308689... I need to run a query to subtract 2 years of time to those ...
4
votes
2answers
906 views

Is there a way to hint to query optimizer to MySQL which constraints should be done first?

This is my current query: SELECT BusinessID as ID, 111151.29341326*SQRT(pow(-6.186751-X(LatLong),2)+pow(106.772835-Y(LatLong),2)*0.98838574205337) AS Distance from ( SELECT * FROM ...
3
votes
2answers
349 views

sp_send_dbmail fails when mailing queries, but no error returned, query just hangs

I have an issue SQL Server 2005. sp_send_dbmail fails when mailing out with the result of a query (inline or attatchment). No error message is given / reported, the query just keeps executing but ...
1
vote
0answers
35 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
1answer
278 views

How to match on a longer word using MySQL Full Text Search?

I have 2 tables : Company and category (category table has tags field, I wrote keywords for each category, I used comma(,) as delimiter) When I search something, it will first search in the company ...
2
votes
0answers
57 views

How to Remove Articles Based on User

I am using merge replication on SQL 2012. I have a very large database with a large number of tables. The subscribers are using netbooks. I have a filtering scheme that controls which tables end up ...
16
votes
8answers
26k views

PostgreSQL is running locally but I cannot connect. Why?

Recently updated my machine from Mac OS X Lion (10.7.4) to Mountain Lion (10.8) and I think it borked my PostgreSQL installation. It was installed originally via Homebrew. I'm not a DBA, but hoping ...
7
votes
3answers
1k views

SQL Server 2012 Standard Edition - multiple instances and memory utilization

If we have multiple instances of a SQL Server 2012 Standard Edition (which has a 64 GB memory limit) on one server which has 192 GBs of RAM, do both instances only have access to the first 64 GBs of ...
1
vote
2answers
781 views

How can I optimize this mySQL table that will need to hold 5+ million rows?

The table has about 12 rows. Indexes: idint(11), Unique, auto-increment, primary ATTACHMENTIDvarchar(14), Unique MLSNUMBERbigint(20) POSITIONint(10) FILETYPEvarchar(32) I'm doing an extended ...
2
votes
1answer
386 views

Cube Designer Aggregation Wizard Optimization Zero Percent Every Time

I am pretty new to SSAS. I have a cube (SSAS 2008 R2) that once had aggregations that has been created using the Aggregation Design wizard. When changing schema a few dimensions, i encountered an ...
3
votes
2answers
450 views

Where should I fix the deadlock?

We have an application database on Server A that is replicated to Server B using push transactional replication. Reporting is done on the replicated copy on Server B. We are having issues where the ...
2
votes
3answers
190 views

What is running right now?

I know I can use "show processlist" to see what is running when I'm in the office. How can I see what is running when I'm not there. Something is running on my server at 3am every morning that is ...
2
votes
2answers
220 views

Proper use of NULL, and utilizing CHECK constraints for business logic vs stored procedures

This question regards the proper use of NULL and utilizing CHECK constraints for business logic vs stored procedures. I have the following tables setup. I normalized the tables to avoid using ...
-1
votes
1answer
38 views

Ordering of rows with different kinds of objects

I have a table of real estate objects. The objects are shown in three lists (sell, rent long, rent short), each object in exactly one list (defined by an ENUM field). I want to add field seq INT to ...
1
vote
1answer
93 views

MySQL GRANT control

How can I write a script to automate MySQL database grants in a very easy way? I have a config file that contains the grant changes I want to make. I want the script to read the config file, and ...
0
votes
1answer
57 views

How to append some letters or numbers to already existing data

I would like to append some data to already existing data, something like 720967537 to 255720967537. All the data in my column is in that format. Is there any way I can do that to all of the records ...
15
votes
5answers
6k views

What is the most efficient way to get the minimum of multiple columns on SQL Server 2005?

I'm in a situation where I want to get the minimum value from of 6 columns. I've found three ways so far to accomplish this, but I have concerns with the performance of these methods and would like ...
11
votes
3answers
653 views

Implications of using a Unique NonClustered Index with Covering Columns instead of a Primary Key

We have a large table [MyTable] which currently has both a PK, and a UNIQUE Non Clustered Index on [KeyColumn] (which has additional covering columns), which seems redundant, and I think I can delete ...

15 30 50 per page