0
votes
1answer
103 views

Embedded select with rank

I am having the hardest time following the tutorials on this site regarding ranking with MySQL. I have a larger problem than others seem to show. My table is constantly updating with single answers ...
1
vote
2answers
490 views

Does a database restore remove existing stored procedures

I have a PROD and NON-PROD system NON-PROD already has a copy of an application PROD database I have also created new stored procedures on the NON-PROD application database and made changes to a ...
0
votes
4answers
140 views

How can I create a fresh copy of a large database on SQL Server?

I have a very large database (400GB) that is now corrupted. I tried repairing it with the repair_allow_data_loss option, but that did not fix the problem so my next option is to restore to a previous ...
2
votes
1answer
983 views

How to optimize multiple self-JOINs?

I'm looking for advice on either optimizing multiple self-joins, or a better table/DB design. One of the tables looks as follows (relevant cols only): CREATE TABLE IF NOT EXISTS CountryData ( ...
0
votes
1answer
110 views

Am I wrong in table design or wrong in selected index when made the table?

I've build web application as a tool to eliminate unnecessary data in peoples table, this application mainly to filter all data of peoples who valid to get an election rights. At first, it wasn't a ...
0
votes
1answer
636 views

HOW to “SUM” and “JOIN” for single query of a poll results?

I have a poll database as CREATE TABLE poll_answer answer_id, answer varchar(255), poll_id int(11), FOREIGN KEY(poll_id) REFERENCES polls(poll_id) ON DELETE CASCADE, PRIMARY KEY(answer_id) ) ...
6
votes
1answer
7k views

Linked server available to users without permissions

I have users seeing a linked server which they are not supposed to see. The linked server is defined so that only I will have access to it, but everybody can see and use it. I have created the ...
2
votes
2answers
2k views

unloading data from oracle dbf files

I have a list of oracle dbf files and I need to restore the information inside these files, there are no control files and anything else. only DBF file http://s9.postimg.org/mxmx0g73j/Untitled.jpg ...
0
votes
0answers
981 views

postgres service suddenly not working after the computer crashed while working

I've been working with postgres on a linux server for the last couple of months. Last week, half of our servers crashed and my one with them. I was in the middle of uploading data to the postgres ...
0
votes
1answer
556 views

Unable to create a new listener in oracle 11g

In net manager i get an error message "A valid logfile is required" when i click on listener and choose '+' button. and then it keeps on giving me that error when i click on any other tab or button in ...
1
vote
2answers
127 views

Format function returning minutes instead of months?

While exploring the new function FORMAT I have come across the following issue, would like to know if any one else has faced a similar problem and found the fix for this, or if it is a bug? SELECT ...
0
votes
0answers
708 views

How to import a text file with '|' delimited data to PostgreSQL database? [closed]

I have a text file with | delimited data that I want to import to a table in PostgreSQL database. PgAdminIII only exports CSV files. I converted the file to a CSV file using MS excel but still was ...
2
votes
1answer
394 views

SSIS - How do I execute a single OLE DB Command for mutiple paths?

I have an SSIS package (2008 R2) that I'm working on and I find myself duplicating the same OLE DB commands repeatedly and whenever there is a change its a nightmare to go back through and update all ...
2
votes
1answer
159 views

How to avoid large joins when determining which rows a user is authorized for?

Typical wep app situation: you have logged in users querying for resources exposed through an API. As a hypothetical example, company administrators quering for their employees' time sheets: company ...
7
votes
3answers
3k views

Splitting SQL query with many joins into smaller ones helps?

We need to do some reporting every night on our SQL Server 2008 R2. Calculating the reports takes several hours. In order to shorten the time we precalculate a table. This table is created based on ...
1
vote
1answer
350 views

Retrieving 10 records from multiple tables

I have two tables where I store post data. What I want to do is to get 10 records from those two tables. Table 1 - all posts, Table 2 posts that user read. There are some scenarios; User has never ...
0
votes
2answers
813 views

Grant access to a table to all users

Is it possible to assign a grant to a table for all users, or a default permission so that when new users are created they will have the specific grants for that table to SELECT, UPDATE, INSERT and ...
2
votes
3answers
2k views

Postgres connection access denied on IPv6 address

Installed PostgreSQL 9.1 x64 on Windows, set up a listen address, but when connecting with pgAdmin I get the following error. Not sure why PostgreSQL is seeing my IPv6 address and not my regular IP ...
4
votes
2answers
1k views

How can row estimates be improved in order to reduce chances of spills to tempdb

I notice that when there are spill to tempdb events (causing slow queries) that often the row estimates are way off for a particular join. I've seen spill events occur with merge and hash joins and ...
0
votes
2answers
305 views

Help my database isn't performing fast enough! 100M Merge with 6M need < 1 hour!

I have a server right now receiving more raw data files in 1 hour then I can upsert (insert -> merge) in an hour. I have a table with 100M (rounded up) rows. Table is currently MyISAM. The table has ...
0
votes
2answers
199 views

Should numeric identifiers like serial numbers be stored as integers?

Many of our databases store numeric tracking codes (like serial numbers) as integers. There is little chance of these codes every getting alphabetic characters, but it still seems like an incorrect ...
0
votes
1answer
314 views

Security Concerns of SQL Server Express for Web e-Voting web application

I am building a database driven web application. The web application is basically an E-Voting website, where users can register and vote on things that concern their community ... etc. The database ...
4
votes
1answer
491 views

financial transactions with and without commissions

I'm building a gambling website. All financial transactions from and to external sources (credit cards, money transfer systems) are subject to commission. Amount of the commission depends on the ...
0
votes
2answers
244 views

Does a SQL Server job run on the server or the local machine?

Does a SQL Server job always run on the server, or will it run in the context of the local machine, similar to a DTS package run from Enterprise Manager on the user's machine? The job in question ...
3
votes
2answers
1k views

Are there design patterns/best practices in writing dynamic SQL in stored procedures? [closed]

I'm an experienced programmer but I'm new to SQL/databases so please bare with me :). One of my current tasks involve editing (and refactoring, if needed) a dynamic generated SQL statement in a ...
2
votes
3answers
843 views

Does Change Data Capture (CDC) work in a SQL Server 2012 AlwaysOn Failover Cluster Instances setup?

Does Change Data Capture (CDC) work in a SQL Server 2012 AlwaysOn Failover Cluster Instances setup? There would be two nodes in the AlwaysOn Failover Cluster Instances setup and two Domain ...
-2
votes
0answers
242 views

SQL server 2012 upgrade causing reindexing to take a long time / fill up log file [closed]

I have a customer who has upgraded their SQL Server from SQL Server 2005 to SQL Server 2012. According to them, no other changes were made. They have an ERP database which does a full reindex once a ...
0
votes
0answers
658 views

Creating Superset and Subset table with relationship mapping

I have requirement in one of the project where different entities like Teacher,School,Student Store addresses in single table and maintain their relationship. Example -School can add teacher and ...
0
votes
0answers
172 views

Rackspace Cloud Databases: incremental backup

Rackspace Cloud Databases are a little bit special in that we do not have access to the bin_log file, they are not servers in the traditional sense. I do have a couple of Cloud Servers with them but I ...
7
votes
2answers
727 views

Is a geographically distributed application with SQL Server replication a good idea?

We are currently thinking about a target architecture for a geographically distributed application. This application tracks and schedules the movements of all material units across various production ...
0
votes
1answer
64 views

Merge subscription behaviour

I have a merge subscription with the ExchangeType parameter set to 1 (upload only). Rows are transferred to the publisher as expected. If I delete a row at the subscriber, the corresponding row at ...
1
vote
1answer
319 views

USER_ID field in alert logs (also in V$DIAG_ALERT_EXT view)

Does anyone know what triggers the USER_ID field in the log.xml to be populated? The value also exists in the V$DIAG_ALERT_EXT view. I've found by observing the logs that if a temp tablespace fills ...
10
votes
1answer
6k views

Parent-Child Tree Hierarchical ORDER

I have to following data in SQL Server 2008 R2. SQLFiddle Schema: CREATE TABLE [dbo].[ICFilters]( [ICFilterID] [int] IDENTITY(1,1) NOT NULL, [ParentID] [int] NOT NULL DEFAULT 0, ...
0
votes
0answers
65 views

Replicate database without Internet connection

I'm working on a company where I have a central DB and several agency databases. See the diagram at here. All the databases are identical, just the data can change and in some cases. I've no internet ...
0
votes
0answers
187 views

How to setup a Postgres-xc streaming replication with master-slave(for HA)?

Can you guys please help me about how to make streaming replication with master-slave configuration using Postgres-xc to confirm an HA environment? Thanks
7
votes
2answers
211 views

Does granting SA rights to a user in SQL compromise the OS?

I'm setting up a server that my company will be managing for one of our clients. This server runs an application that is managed by a 3rd party. We are responsible for the server and OS and the ...
1
vote
1answer
157 views

Does DBMS (e.g. of SQL SERVER 2008) use virtual memory?

Or in other words ... . Does the DBMS somehow circumvent the OS Cache manager and acccess the memory directly OR it lets the OS do its job, behave as a normal process and use the concept of virtual ...
3
votes
2answers
4k views

Reduce Clustered Index seek cost SQL Server 2008 R2

I am running a query and it has records in the hundreds of thousands, it takes more than 20 mins to fetch data. After running the execution plan i noticed that clustered index seek cost can be be the ...
7
votes
3answers
7k views

How to see what is cached in memory in SQL server 2008?

Is there a way how to find out what is cached in SQL Server 2008 R2? I have found the following nice article: ...
3
votes
2answers
570 views

How large will the Transaction Log backup be?

I encountered a production database of 12 GB with a log of 90 GB. Full and differential database backups are made with a third-party backup tool, but no one is backing up the transaction log so it got ...
0
votes
1answer
861 views

How would I store the result of a select statement so that I can reuse the results to join to different tables?

How would I store the result of a select statement so that I can reuse the results to join to different tables? This will also be inside a cursor. Below is some pseudo code, in this example I have ...
0
votes
1answer
213 views

How to add custom sequence number in table which is going to be populated automatically

I have table something like this CREATE TABLE [dbo].[ado_test_table]( [id] [int] IDENTITY(1,1) NOT NULL, [tip] [varchar](10) NOT NULL, [datum] [datetime] NOT NULL, [doc_number] [int] ...
1
vote
1answer
530 views

Autogrow of database1_log file in database database1 took 1010871 milliseconds

in past i had a problem of that query been executed for 7 days. i couldnt find any solution. so i created again new database with indexes. Now i am running a simple query: UPDATE query query has ...
0
votes
1answer
230 views

Database with insert data every 2 minutes

I have a site to develop into PHP and mysql where I take, with a cron, every two minutes 10 xml from a server parse each and insert data into my database. Well this data are simple string (maximum 10) ...
0
votes
2answers
140 views

How mysql process where condition

I have a query like Select * from tbl1 WHERE ( price > 10 AND qty > 200 AND condition=1 AND name like '%abc%') My question is how MySQL will process this? My concern is that I want ...
0
votes
5answers
4k views

Copy a SQL Server database from one server to another on demand

I have two servers, Prod and Test, both running SQL Server 2008 RTM. Is it possible to have a PowerShell- or VBScript that could copy a database from one server to another? The copy should of course ...
5
votes
1answer
7k views

How to solve “The table … is full” with “innodb_file_per_table”?

I have a MySQL database that holds a large amount of data (100-200GB - a bunch of scientific measurements). The vast majority of the data is stored in one table Sample. Now I'm creating a slave ...
2
votes
1answer
318 views

How long takes populating catalog in SQL Server 2008 R2 when update a row?

I have installed SQL Server 2008 R2 with FullText search feature installed. I created a catalog and fulltext index on a table (let's say Table1). I used the following commands (sql queries): USE ...
0
votes
2answers
953 views

Use timestamp(or datetime) as part of primary key (or part of clustered index)

I use following query frequently: SELECT * FROM table WHERE Timestamp > [SomeTime] AND Timestamp < [SomeOtherTime] and publish = 1 and type = 2 order by Timestamp I would like to optimize ...
1
vote
1answer
277 views

Sql Server 2012 and native client 10

What is the difference between SQL Server Native client versions 10 and 11? Can I use Native Client 10 with SQL Server 2012 running?

15 30 50 per page