Database Administrators Stack Exchange Newsletter

Top new questions this week:

Is it bad to have index space larger than data space?

Often I need to run queries against large tables that don't have the right index. So I ask the DBA to create such index. The first thing he does is look at the table statistics and see the index space ...

sql-server index  
asked by hjf 18 votes
answered by Brent Ozar 31 votes

Why Do My Nonclustered Indexes Use More Space When I Delete Rows?

I have a large table with 7.5 billion rows and 5 indexes. When I delete roughly 10 million rows, I notice that the nonclustered indexes seem to increase the number of pages they're stored on. I ...

sql-server sql-server-2014 nonclustered-index  
asked by Michael J Swart 16 votes
answered by Brent Ozar 22 votes

Fastest way to split/store a long string for charindex function

I have a 1 TB string of digits. Given a 12-character sequence of digits I want to get the start-position of this sequence in the original string (charindex function). I have tested this with a 1GB ...

sql-server sql-server-2017 string-searching physical-design string-splitting  
asked by Werner Aumayr 6 votes
answered by Paul White 4 votes

Solution to assigning unique values to rows with finite collaboration distance

I have a table that can be created and populated with the following code: CREATE TABLE dbo.Example(GroupKey int NOT NULL, RecordKey varchar(12) NOT NULL); ALTER TABLE dbo.Example ADD CONSTRAINT ...

sql-server sql-server-2016  
asked by basketballfan22 6 votes
answered by Paul White 4 votes

Are CNAME aliases for connection strings a good idea?

To be very flexible and move database to different servers more easily, we came up with the idea of using an alias per database. So by simply changing a DNS entry, we can route all queries to a ...

sql-server connections network dns  
asked by SwissCoder 6 votes
answered by Tony Hinkle 6 votes

SQL Server 2016 & 2017 Force Plan failing with reason 8695

I'm trying to force a plan using query store but it keeps failing with reason 8695 according to data in SYS.QUERY_STORE_PLAN the last_force_failure_reason_desc is 'General_Failure'. Does anyone know ...

sql-server sql-server-2016 stored-procedures sql-server-2017 query-store  
asked by Shawn 5 votes

Is there any way to determine how many rows a transaction has modified (before the transaction ends)?

I have a ~320 million row table on which I run the following query: UPDATE my_table SET state = TRIM(state) Needless to say this has been running for 90+ hours (since thursday afternoon) and has ...

postgresql update monitoring  
asked by Giacomo Alzetta 5 votes
answered by Nick Barnes 2 votes

Greatest hits from previous weeks:

Remote MySQL connection fails (10060) - "Can't connect to MySQL server on domainname.com(10060)"

I have developed an application in VB6, and am using an online MySQL database server for storing my application's data. The first time I try to connect to my database server is successful, but after ...

mysql connectivity  
asked by Ashok Gujjar 6 votes

How to use sqlplus to connect to an Oracle Database located on another host without modifying my own tnsnames.ora

I want to connect to an oracle database located on another host using sqlplus. This page suggested adding an item on my tnsnames to conenct to that database local_SID = (DESCRIPTION = (ADDRESS ...

oracle sqlplus  
asked by Louis Rhys 75 votes
answered by René Nyffenegger 74 votes

How do you show SQL executing on an Oracle database?

How can you show the SQL that is currently executing on an oracle db? Extra information that would be useful would include user, session id etc.

oracle  
asked by Clarkey 22 votes
answered by David Mann 29 votes

Writing select result to a csv file

We need to write the SELECT query results to a csv file. How can it be done using T-SQL in SQL Server 2008 r2? I know that it can be done in SSIS, but for some reasons, we don't have this option. I ...

sql-server-2008 t-sql  
asked by Sky 35 votes
answered by RK Kuppala 50 votes

Why Does the Transaction Log Keep Growing or Run Out of Space?

This one seems to be a common question in most forums and all over the web, it is asked here in many formats that typically sound like this: In SQL Server - What are some reasons the ...

sql-server transaction-log shrink auto-growth recovery-model  
asked by Mike Walsh 250 votes
answered by Mike Walsh 308 votes

How to make sqlplus output appear in one line?

I have a table with 100 columns. When selecting data in SQL Plus the output wraps, making it difficult to read. What I'd rather like is either a horizontal scroll bar to appear or somehow send the ...

oracle sqlplus  
asked by Kshitiz Sharma 36 votes
answered by miracle173 51 votes

How to handle TimeZone properly in SQL Server?

My local development server is in the Middle East, but my production server is in the UK. I need to show the date to the user in their time zone. For example, if a user is in Saudi Arabia then I ...

sql-server sql-server-2008 timezone  
asked by user960567 23 votes
answered by Jon Seigel 39 votes

Can you answer these questions?

Design table that solve a service payment or a package service payment?

I am learning and practicing some database designing and case study on Selling Services on Internet. In my requirement, user can buy a post service and add more extra option if they need. In fact, ...

database-design  
asked by tammary 1 vote

Error writing to file c: windows\syswow64\mfc100.dll during installation of SQL Server 2014

During installation of SQL Server 2014 there is error appears Error writing to file c: windows\syswow64\mfc100.dll verify that you've access to that directory as you can see below image, I navigate ...

sql-server-2014  
asked by zohaib 1 vote

Select one record from LAG Query

I'm having difficulty getting data from a query using the LAG method. The issue is that I only need one record from the entire set pulled down, but when I filter out that record in the WHERE clause it ...

sql-server query  
asked by Vandel212 1 vote
answered by Randi Vertongen 0 votes
You're receiving this message because you subscribed to the Database Administrators newsletter.
Unsubscribe from this newsletter       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038

<3