2
votes
0answers
50 views

Can I open a table twice using different recordsets and update the second without affecting the first?

Context: Windows 7, SQL Server 2000, JScript. I have a recordset opened as follows: var cmd = "SELECT * FROM Table1 WHERE Field1 = 9 AND Field2 = 0;"; var oRS = new ActiveXObject("ADODB.Recordset"); ...
3
votes
1answer
200 views

Load Testing Crash Course

Can someone point me at a good resource to get a crash course in load testing. I have a sql server machine that I need to load test but I havent been thruogh the process before. Also we do not have ...
4
votes
1answer
78 views

Covering Index Question

I have the following query Select Pt.PRODID, PT.INVENTREFID, Inv.ItemName, PT.ItemID, Configid, Pt.QTYSCHED, PT.DLVDATE, Pt.CREATEDDATETIME, pt.SCHEDEND, CASE Left(PT.INVENTREFID, 3) WHEN ...
1
vote
1answer
479 views

PostgreSQL no relations found

I am running ruby and rails app with postgresql database, and I want to do batch import from text file to the database. I've configured the database and if I run psql and \l to list all databases, I ...
10
votes
3answers
2k views

Unique Identifier with Extra Characters Still Matching in Select

We are using SQL Server 2012 with a unique identifier and we've noticed that when doing selects with additional characters added onto the end (so not 36 chars) it still returns a match to a UUID. For ...
1
vote
2answers
328 views

MySQL5.6 on Mac OS X 10.6.8 problems when granting permissions to root

I'm having serious problems with a MySQL 5.6 instance on a Mac Server. We had to upgrade MySQL to a newer version, but it turned to be a bad idea, as we lost control to it. We had a backup of the ...
1
vote
1answer
376 views

Possible reasons for slow BLOB updates in Oracle?

We have an application that transfers .bmp images as BLOBs to an Oracle table. One of the users of the app has complained that it is taking 2-3 seconds to transfer each image. Each image is ~1.2Mb. ...
0
votes
3answers
4k views

Export Postgres table on remote server to CSV file on local machine?

I have access to DB on remote server where I can do only select command, So, I can execute: COPY products TO '/tmp/products.csv' DELIMITER ','; But on that server I don't have permission to ...
3
votes
1answer
894 views

Oracle Illegal use of long datatype when moving tablespace to bigfile

I am currently migrating all the tables in my database to a bigfile tablespace. I have written a script to do this and all tables are migrated successfully except one. I am given the error: Error ...
3
votes
1answer
2k views

Table Size Analysis on SQL Server 2000

Our SQL Server 2000 database .mdf file is 27Gb large which seems much larger than is plausible. Using the following query we tried to analyse table sizes: select cast(object_name(id) as varchar(50)) ...
2
votes
2answers
182 views

Is this relation in 3NF?

I created a relation called Customer and defined as: I just wanted to know if it is in 3NF? My concern is regarding address, since customer may have the same address.
2
votes
2answers
370 views

EMS SQL manager permission problem

I have a strange problem with EMS SQL Manager. I'm using MySQL 5.5 with linux servers. One of my developers need to edit store procedure, so I grant him: GRANT CREATE ROUTINE, ALTER ROUTINE ON ...
2
votes
2answers
162 views

SQL Max() revision number

This SQL returns a table with everything unique, which is what I want. However, if there are two (or more) event numbers, I need it to return the line with the highest rev_num for that eventnum. I ...
2
votes
1answer
261 views

Apply in a CSV file to multiple databases

Recently, I have been working with a client whom has asked us to provide their dataset for use in a mobile application we are making for them. The requirements for this project include the ability to ...
2
votes
2answers
720 views

Is there a way that I can export a list of all table triggers on a server?

I have two SQL Server instances that I manage. One is a SQL Server 2000 instance, and the other is 2005. Some where, on these servers, I recall setting up a couple table triggers that were executed ...
1
vote
1answer
98 views

Which database is designed for storing and incrementing values?

We're trying to build a stats server that stores visits for each document on a section for a specific date, so we need a table that has the following parameters: documentID sectionID date visits ...
2
votes
1answer
771 views

How can I calculate time spent at work in a single column?

I would like to calculate the amount of time spent working from rows of data that contain a single date/time field. The first occurrence on a given day can be considered the start time, with the ...
2
votes
2answers
121 views

Logging only mySQL logins on heavily used system

I have an audit requirement where they want all database access (logins) logged. We have a very large distributed system of hundreds of mySQL servers (shards, slaves, slaves of slaves) that are ...
1
vote
0answers
32 views

Defining the Relationship - Some Basic Help [closed]

I thought I had this figured out but I am starting to doubt myself on something that should be simple. I have a table of Group, and a table for Activity. Each Group has one Activity. Different groups ...
3
votes
2answers
1k views

Why do I get “The initial snapshot for publication is not yet available.”?

We are using Transactional Replications with updatable subscriptions. 1 publisher, 1 subscriber. SQL Replication started encountering a constraint error on 3/6 at 10AM because people at two different ...
1
vote
2answers
116 views

Does this query make sense?

I recently migrated a database from Sybase ASE to Microsoft SQL 2008r2. One category of queries that was broken in transit is: SELECT person_id FROM leaveperiods WHERE group_id=146 GROUP BY ...
2
votes
3answers
17k views

List all permissions for a given role?

I've searched around all over and haven't found a conclusive answer to this question. I need a script that can give ALL permissions for an associated role. Any thoughts, or is it even possible? ...
0
votes
1answer
280 views

Integer comparison in MySQL. does it cause lots of overhead?

I have an 8 digit number in my db. I want to do a select on the table in MySql (Innodb) and get the list of all numbers that are equal or smaller than my number. Then I sort them from larger to ...
2
votes
1answer
74 views

What is the equivalent of a “Certificate of Destruction” when using a cloud-hosted database?

We have a Rails application hosted by Heroku and using an Heroku Postgres database. Some of the information we store is considered to be sensitive by our users, and we've been asked if we can provide ...
0
votes
1answer
465 views

Logging and saving user activity

Database:Oracle 11gR2 OS: Windows 2008 Server R2 I'm not trained DBA, just have to run things on an Oracle database temporarily, which is used to perform OLAP processes. I need to automatize user ...
4
votes
3answers
2k views

Linked server error not caught by TRY-CATCH

I am setting up a job to loop through a list of linked servers and execute a specific query against each one. I am trying to execute the query inside a TRY-CATCH block so if there's a problem with one ...
0
votes
1answer
4k views

Set encoding from within SQL*Plus

I have a large set of files with SQL commands that I run with a SQL*Plus script that uses the @@ operator. I run the script on third-party computers (or even send it by e-mail) so I'd like to make it ...
4
votes
3answers
343 views

Backup strategies for zero data loss

I am working on one project and it has around 100K records. We can afford a downtime of 1 day but we need the data to be always available to us in latest state. I've gone through two options: 1) ...
0
votes
1answer
43 views

Copy Permission From Windows Based user To Local user

I want to know if it is possible to copy the permissions of a windows user to a locally created user on SQL server?
13
votes
4answers
2k views

Is it possible to make one column readonly?

I'm curious if it is possible to create a table with a column that can never be changed, but the other columns of the table can. For instance I could imagine a CreatedByUser column that should never ...
3
votes
0answers
142 views

Key Lookup and Full-text index

I have the following query: SELECT T2.Title FROM TitleTable T1 INNER JOIN TitleTable T2 ON T2.FKID1 = T1.FKID1 WHERE T1.FKID2 = @ID_PARAM1 AND T2.FKID2 = @ID_PARAM2 AND ...
1
vote
1answer
12k views

How to monitor space usage on ASM diskgroups

Last night the recovery area on one of our Oracle Database Appliances went full. This was reported in one of the database alert logs, and we were able to clear out some space before the next log ...
0
votes
3answers
4k views

I killed a session and it is still running?

I have Oracle 9.2 I view my running session with the query: SELECT S92700.SYSUSR_VW."NAME", SID,SERIAL#, AUDSID FROM v$session, S92700.SYSUSR_VW, S92700.SECUSR WHERE S92700.SYSUSR_VW.SESSIONID = ...
0
votes
2answers
315 views

Large time difference between two almost identical simple queries…why?

I'm trying to understand why is there so much difference in execution time and CPU usage between two simple queries that only differ in a computation. The queries are the following: SELECT ...
5
votes
2answers
177 views

Is it possible to enforce unique values in a column, excluding nulls?

I have a business requirement to have a FK field on TableA referencing TableB. If there is a value in TableBID, it should be unique, but it's not mandatory, so there could be multiple records with ...
0
votes
1answer
449 views

upgrade mysql 5.1 to 5.5 on Ubuntu 11.10

I currently have mysql server 5.1 installed via apt-get on my production Ubuntu 11.10 server root@Ubuntu-1110-oneiric-64-minimal$ dpkg --get-selections | grep sql-server mysql-server ...
3
votes
2answers
1k views

MySQL information_schema doesn't update

I have a database, say abc, in mysql server. It has only one table named test. test uses innodb engine and I've set innodb_file_per_table to true. After I run the query delete from abc.test, I want ...
1
vote
2answers
2k views

How to find DELETE and UPDATE statements that have been executed on a database?

I am trying to find out what delete and update statements have been executed on a certain database in a certain period of time. I came across this following query, but it generates an error message: ...
1
vote
2answers
1k views

How do I add a database in IBM DB2

I'm supposed to migrate a MySQL database into IBM DB2, but I thought I'd take baby steps first before I do something like that. So for now, I'd just like to add a database. I'll admit that I have no ...
1
vote
1answer
202 views

Minimising downtime implementing merge replication on live system

Background We have three Servers running SQL Server 2008 which all contain a Product database. These are currently kept in sync once per day by sending a copy of the MDF to the two Subscribing ...
4
votes
3answers
7k views

PostgreSQL user can not connect to server after changing password

I've met this with 4 roles I created: After changing password for a user in pgAdmin III using the GUI (1), that user can not log in any more. pgAdmin III show error message: An error has occurred: ...
0
votes
1answer
33 views

mySQL Quickly find rows linked to another row

For example if I have a posts table with id and a likes table width id post_id user_id, how can I set up the database to organize the likes table by post_id in order so queries are faster? I can't ...
5
votes
1answer
3k views

Log Shipping - RESTORE WITH STANDBY - on SQL Server 2012 keeps breaking

We are using log shipping and RESTORE WITH STANDBY on SQL Server 2012 in order to restore the database in read-only mode for reporting purposes. However, the log shipping setup keeps breaking after ...
0
votes
1answer
146 views

What is the maximum number of rows in a clustered index on datetime column?

I would like know what the max no of rows is in a clustered index (non-unique) on a datetime column table in SQL Server 2008R2.
0
votes
1answer
27 views

Automatically create linked row in a different table

What I mean is that for example if I have a table user with id name prefId, and a second table preferences with id etc..., is it possible that when I add a row to user, it would automatically create a ...
1
vote
1answer
306 views

Why do MySQL MyISAM table indexes go out of date?

I have few MyISAM tables, where only the auto_increment primary key is up to date with the number of columns, but not other indexes. Any idea, why this happens?
0
votes
1answer
492 views

Efficient way to move rows across the tables?

This is somewhat long question as I would like to explain all details of the problem. System Description We have a queue of incoming messages from external system(s). Messages are immediately stored ...
2
votes
2answers
291 views

Relational database for address model

I want to design an "Address" model for all types of entities like users, businesses, etc. I have two types of main models: one is User and the other is Business. Each one has different address types ...
0
votes
1answer
700 views

SQL Server 2005 upgrade to Service Pack 4 (SP4) via command line

I have been wracking my brain over upgrading SQL Server 2005 to SQL Server 2005 SP4. I have a script for installing new instances of SQL Server for all versions and they all work wonderfully. Problem ...
1
vote
2answers
278 views

SQL Server 2005 upgrade service pack via command line

I have been wracking my brain over upgrading sql server 2005 to sql server 2005 sp4. I have a script for installing new instances of sql servers for all versions and they all work wonderfully. Problem ...

15 30 50 per page