1
vote
1answer
428 views

Difference between DATE(time_field) AND time_field in a WHERE clause

I have 3 tables: users movements unique_ids I want to get the records gotten from march until now of the users registered in march, counting the unique id of their movements with a distinct and the ...
0
votes
0answers
972 views

How can I resolve timeout errors in SSIS around midnight every night?

I find a pair of these in my Application Event Log a little after midnight every night: The SSIS Execution Process could not write to the IS catalog: MyServerName:SSISDB Error details: Unable to ...
4
votes
1answer
197 views

How to audit users connections via ODBC to all dbs in SQL Server 2008 R2

I am not a trained DBA, but I manage a software application that uses SQL Server for the back end. The applications manages "projects" and each project has its own database. Because of the limitation ...
0
votes
1answer
247 views

Select post and concatenating all categories it belongs to

I have 3 DB tables POSTS +----------+----------+----------+ | id | title | content | +----------+----------+----------+ CATEGORIES +----------+----------+ | id | title | ...
0
votes
0answers
22 views

Should a surrogate key reflect one of my columns? [duplicate]

I currently have a column called LoadID which is a surrogate key that just increment by max()+1. I also have LoadNumber which always seems to have the exact same value of LoadID, since they will ...
2
votes
1answer
143 views

Is there a way to pass to execute immediate only once a variable but use it several times?

I have a Cursor that gets its data from a script along these lines: OPEN myCursor FOR SELECT value1 AS Value1, myPackage.function1 (value1, :myId) AS Result1, myPackage.function2 (value1, :myId) ...
3
votes
1answer
123 views

Could 'Maximum Server Memory' be too low for large batched delete with captured output?

I'm trying to improve the performance of a SQL server database backup program that will create a new database to hold one years worth of report records, delete report records out of the main database, ...
0
votes
1answer
32 views

selecting rows that have n foreign key conditions satisfied

I'm trying to filter a master table rows based on 2-more conditions from the relative foreign key relation, i came up with this which is working fine, but i just can't convince my self that it's that ...
0
votes
1answer
113 views

Check all tables in a schema for X fields?

I want to make sure that all of the tables in my schema have fields named "updateddate" and "createddate". Obviously, I could check them manually, but how can I generate a list of tables that are ...
4
votes
1answer
2k views

SQL Server 2005 Restore Backup Status Recovery Pending

So at work something dreadful happened a database server went down and I am having an issue recovering one of our databases from our backups. When I try to restore from a backup using SQL Management ...
1
vote
1answer
647 views

How should I set up SQL Server Login permissions for access to website on a different server using Windows Authentication

I know this question doesn't really belong here, but I posted on the MS IIS Site and am still hoping for a reply. I have an intranet site created with .NET Framework 4.0 in Visual Studio 2012 and I ...
0
votes
1answer
319 views

Tablespace of an index organized table

I want to find the tablespace of an index organized table with primary key. With dba_segments I can only find the tablespace for the primary key. But how can I find the tablespace for the table?
2
votes
1answer
2k views

MySQL Foreign Key Prevents Deleting Table — But Table is Empty

Why would dropping an empty table produce a foreign key error? In MySQL, I have a table with the following definition CREATE TABLE `enterprise_rma` ( `entity_id` int(10) unsigned NOT NULL ...
1
vote
0answers
169 views

Stored procedure taking much longer than query [closed]

I have a simple code segment that runs in about 1 second when run alone, but more than 5 minutes when deployed as a stored procedure. I'm using sql server 2008. Unfortunately, I can't post the code ...
1
vote
1answer
184 views

How can I have a gap in the SQL Server Job Agent history for a job?

I have a job (Update Tickets) scheduled in Job Agent with a single schedule of "Occurs every day every 30 minute(s) between 12:00:00 AM and 11:59:59 PM. Schedule will be used starting on 11/4/2013." ...
0
votes
0answers
58 views

Debugging long Oracle queries and identifying offending data for 'Expression type does not match a required type' error

I have a long running query with a large number of complex XQueries. This queries used to work but more recently it is giving me Expression type does not match a required type error. I suspect ...
4
votes
1answer
571 views

MongoDB presplitting chunks for compound shard key

In my mongodb setup I have a compound shard key {"region" : 1, "foo" : 1, "bar" : 1} and I know the values region can be and that each region should be on one chunk. Therefore I'd like to pre-split ...
0
votes
0answers
30 views

Lock rows for long running transactions

I have a question table from which agents try to answer 5 questions at a time. Obviously, I want to avoid agent collision i.e. if an agent is answering a question, other agents can not work on it. Is ...
1
vote
2answers
1k views

Proper Shutdown of SQL Servers in a Cluster

I was just wondering what the best approach should be for shutting down an Active/Active Cluster where both nodes need to be shutdown for disk maintenance. I was thinking of this process: Open ...
2
votes
1answer
4k views

Moving SSIS Packages to New Server

I have a number of SSIS packages in a number of folders on MSDB SSIS on SQL Server 2008R2. We are migrating to a new server host but remaining on SQL Server 2008R2. How can I copy/migrate these SSIS ...
-2
votes
1answer
63 views

Add default constraint from another table

How to add a default constraint to a table such that the value that will be used as default will be from another table's columns? i have created a table MY_TBL in which having a column CURRENCY_CD ...
1
vote
1answer
94 views

How to get list of enabled/disabled features of SQLAnywhere

I'm looking to get a list of features, which are installed or enabled/disabled on a given SQLAnywhere instance. dblic is only showing the 'possible' feature based on lice, but not the actually ...
1
vote
3answers
215 views

How to get the first or last row in ordered result set, depending by column value?

I have the follwoing result set from the table PUNCHREPORT EMPLID Name PUNCHDATE PUNCHTIME DEVICETYPE .................................................................. 70 ...
1
vote
1answer
522 views

Restore mysql from database snapshot

I have a folder containing the snapshot taken from a database. They are all in the format organisation_product_tablename.sql. How can I restore them back into the database? EDIT 1: I managed to ...
1
vote
1answer
265 views

Running queries directly on DB2 databases

Just have a general query, if it is really fine or safe to run long select queries on RDBMS production Databases specifically DB2? If NO, what are the major risks and issues in executing select ...
1
vote
0answers
102 views

Issue with MDS data when viewed in Excel addin after connecting to MDS Model

In MDS 2012, while exploring for a entity, I can see the data in Client and Product column are properly assigned as Code and Code {Name} as seen below: but while connecting to the MDS model via ...
1
vote
0answers
470 views

PostgreSQL continuous archiving - use snapshot for base backup on AWS?

I'm new to AWS and PostgreSQL admin and have been poring over the docs trying to come up with a good backup strategy for a fairly simple setup. I have a single Amazon Web Services EC2 instance that ...
1
vote
3answers
1k views

How to use DAY/WEEK/MONTH/YEAR constant as parameter in stored procedure?

Assume I have a table looks like this: Scores { Id uniqueidentifier, ScoredAt datetime, Value int } Basically I want to create a stored procedure that works similar to this ...
0
votes
2answers
98 views

How do I translate this query from MS Access into SQL Server

How do I translate this into SQL Server: select -Sum((12=[GroupNum])*[BoardStatus]) AS G12 FROM QryAllBoardsByPacketIDs INNER JOIN tBsReportGroups ON ...
0
votes
0answers
17 views

setting auto-increment value of primary key to maximum in postgre sql [duplicate]

the sequencing of my auto incremented id value which is also primary key of the table has changed due to some unknown reason. i want to know whether i can reset this value to the maximum value by ...
1
vote
1answer
1k views

What is DBCC CHECKIDENT current column value

DBCC CHECKIDENT output includes a "current identity value" and a "current column value". I can see that "current identity value" is the identity that will be assigned to the next row. But what is the ...
2
votes
1answer
707 views

Difference between pg_column_size(table.*) and pg_column_size(table.col1) + pg_column_size (table.col2)

From PG DOC pg_column_size(any) : number of bytes used to store a particular value (possibly compressed) pg_column_size shows the space used to store any individual data value Example: ...
3
votes
0answers
145 views

Using Import Wizard with Access - No null values

I am trying to import a table from Access to SSMS using the Import Wizard but when I do the resulting table has a lot of empty strings instead of the NULL values that I am expecting. How do I make ...
0
votes
1answer
70 views

How can I link to query file that opens in SQL Server Management Studio showing database login window?

Background: I have many tasks at work everyday. I have a query at work that needs to be performed everyday(number of queries may increase). I have general(good enough) ability in computers, ...
3
votes
3answers
3k views

T-SQL Calculate average value for Duration Field

Can anyone please help me on this.. I have a column in my table that stores the duration in an nvarchar field formatted as '00:00:00'. How do I calculate the average duration? I read some other ...
0
votes
1answer
2k views

How to reference a table from another schema inside a package?

I am using TOAD to create a package in a Schema that I have am owner. My package uses tables of another schema. The package has a procedure that uses a cursor. When I create the package I get ...
0
votes
1answer
1k views

Bypassing Password Verify Function

I am considering making a recommendation to enforce a password verify function that will not allow users to change their own passwords. My understanding of the PASSWORD_VERIFY_FUNCTION in Oracle is ...
1
vote
1answer
135 views

More Details for MySQL's errorno:150

When MySQL can't create a table due to a foreign key constraint problem, it returns the following error Can't create table 'dbname.table_name' (errno: 150) Is there anyway to have MySQL tell you ...
0
votes
1answer
61 views

two auto incrementing columns

OK I have hit an issue, now I was going to look at having two auto incrementing columns, but I cant using InnoDB. So I am after a Solution. I have a table called queue. Everything to do with my task ...
1
vote
1answer
44 views

How can a dba at a non-profit heathcare SMB use existing customer data to find out information about potental customers? [closed]

Now maybe this isn't a question for a dba Q&A board, I could be wrong; If I've misjudged this, please send my question elsewhere in the SE network. I work at a non-profit healthcare SMB, and ...
5
votes
1answer
63 views

Concatenation behaves differently on two servers

I have two servers (not master/slaves of each other), each running MySQL 5.1.71-log. One server 1 (which happens to be in the US), the following query returns good results: select ...
1
vote
2answers
719 views

What is a good solution for reliably transferring data between SQL Server and PostgreSQL? [closed]

In analyzing some of our business data, we're realizing that we need to join data across disparate data sources. For example, our application data is warehoused in Postgres (ported from MongoDB via ...
0
votes
1answer
66 views

Postgresql Function Trying to Insert into 1 row instead of 2

Postgresql 9.3, Mac OS X 10.6.7 I created this function and I would like to insert both results into the same row. Obviously the way I have it inserts into 2 rows. First, here is the Table T1: ...
0
votes
1answer
870 views

SQL2542N - No match for a database image file was found based on the source database alias

I'm trying to restore a DB from a Linux system to a Windows. I'm working with DB2 9.7.7. I want to create a new DB with the restored DB. The DB file has this name: ...
0
votes
1answer
48 views

To check who has updated my database

I have server database MySQL which is connected to different network(or ip address) i want to find out which user has updated what and when ? can log file help me in this if so how ? please can ...
2
votes
1answer
659 views

Mirror failure after windows updates - possible cause?

Over a dozen SQL Server mirrors had windows updates installed this morning - 2 of which developed serious faults afterwards. The windows updates installed where: KB2939576 KB2957189 KB2957509 ...
2
votes
1answer
3k views

Create new Read Only user on DB2 on the whole database

I am an oracle/sql server DBA having limited knowledge in IBM DB2. We have DB2 9.7 fp4 running on AIX 6. I would like to create a new user and grant him READ only privilege on a particular database. ...
0
votes
2answers
2k views

Error changing mysql 5.6 default port

I've changed my.ini with port=3308 but after restart the service mysql 5.6 is working in the same default port 3306. I've tried in mysql 5.5 and it worked fine. C:\Archivos de programa\MySQL\MySQL ...
0
votes
0answers
726 views

data pump error

I have 2 database in the same host. JDETST (for test) JDEPRD (for production) JDETST is a old copy of JDEPRD (now with different data but non parameter) If i do an export of JDEPRD: export ...
6
votes
4answers
317 views

Store millions of rows of denomalized data or some SQL magic?

My DBA experience doesn't go much further than simple storage + retrieval of CMS style data - so this may be a silly question, I don't know! I have a problem whereby I need to lookup or calculate ...

15 30 50 per page