Friday, May 27, 2005
Thursday, May 26, 2005
This Sunday will be the release of our Reporting Services solution. I'm getting kind of nervous as they haven't installed our production servers yet and they should be ready by the end of the week. There is a lot of pressure on the solution as the current solution delivers the reports with unacceptable delays. Another problem is that the people from the union are very displeased with this. Generating the reports on time and with the correct information is of major importance.
I'll let you know whether I'm happy or sad come Tuesday :-)
I'll let you know whether I'm happy or sad come Tuesday :-)
Friday, May 20, 2005
I saw this cool product called SSW SQL Audit.
As soon as I find some time I'll test it. I'll keep you updated.
http://www.ssw.com.au/SSW/Products/ProdSummaryList.aspx
As soon as I find some time I'll test it. I'll keep you updated.
http://www.ssw.com.au/SSW/Products/ProdSummaryList.aspx
UPDLOCK
The UPDLOCK locking hint is a very interesting one.
It prevents other connections from updating a record but allows other connections to still read the information. It assures you that your process will be the next in line for an exclusive lock. SQL Server actually uses update locks before acquiring an exclusive lock (eg. UPDATE with a WHERE clause). It happens so fast most of the times that they probably won't popup in the locking information you get to see.
To prevent conversion deadlocks (typical in a read and update transaction) it is a good idea to use this locking hint (you'll probably want a REPEATABLE READ or SERIALIZABLE isolation level for these kind of transactions too).
The UPDLOCK locking hint is a very interesting one.
It prevents other connections from updating a record but allows other connections to still read the information. It assures you that your process will be the next in line for an exclusive lock. SQL Server actually uses update locks before acquiring an exclusive lock (eg. UPDATE with a WHERE clause). It happens so fast most of the times that they probably won't popup in the locking information you get to see.
To prevent conversion deadlocks (typical in a read and update transaction) it is a good idea to use this locking hint (you'll probably want a REPEATABLE READ or SERIALIZABLE isolation level for these kind of transactions too).
Thursday, May 19, 2005
Finally found some time to stress test our Reporting Services solution on the servers that will soon run in production.
With 1 DB server and 2 App servers we are generating 32 reports/sec. Quite a nice result as our target was 8/sec :-)
If you want more information or details feel free to contact me.
With 1 DB server and 2 App servers we are generating 32 reports/sec. Quite a nice result as our target was 8/sec :-)
If you want more information or details feel free to contact me.
Wednesday, May 18, 2005
Reporting Services weirdness :s
In order to get a text from a database to display in the page footer you have to include a textbox in the data region and then reference this textbox in a second textbox which you create in the footer region.
No problem so far, a bit weird but not too much trouble. However, when exporting to PDF the footer would just display on the first page and not on all the following pages.
I have solved it by defining an extra parameter, clearing the prompt text and setting the default value to From Query. Select the correct Dataset and the field you would like to use.
Works like a charm.
There was one little issue left though. The report would fail if the stored procedure that retrieved the parameter value would not return any records. I have solved this with the following simple yet effective workaround:
DECLARE @Description varchar(1024)
SELECT @Description = [Description] FROM tbl_document_caption WHERE ...
SELECT @Description as [Description]
In order to get a text from a database to display in the page footer you have to include a textbox in the data region and then reference this textbox in a second textbox which you create in the footer region.
No problem so far, a bit weird but not too much trouble. However, when exporting to PDF the footer would just display on the first page and not on all the following pages.
I have solved it by defining an extra parameter, clearing the prompt text and setting the default value to From Query. Select the correct Dataset and the field you would like to use.
Works like a charm.
There was one little issue left though. The report would fail if the stored procedure that retrieved the parameter value would not return any records. I have solved this with the following simple yet effective workaround:
DECLARE @Description varchar(1024)
SELECT @Description = [Description] FROM tbl_document_caption WHERE ...
SELECT @Description as [Description]
Check out this website.
It was created by a friend of mine and I promised I would promote it :-D
http://www.lollersaurus.com
It was created by a friend of mine and I promised I would promote it :-D
http://www.lollersaurus.com
Tuesday, May 17, 2005
It appears that there is an issue in SP4 for SQL Server 2000 with AWE.
From the Microsoft website:
From the Microsoft website:
Warning: Microsoft has found an issue with the final build of SP4 that
impacts customers who run SQL Server with Address Windowing Extensions (AWE)
support enabled. This issue only impacts computers with more than two gigabytes
(2 GB) of memory where AWE has been explicitly enabled. If you have this
configuration, you should not install SP4. Microsoft is currently working on the
problem and will issue an update soon.
Wednesday, May 11, 2005
64bit in the everyday environment.
By the looks of this column is doesn't look too good (for the time being though).
By the looks of this column is doesn't look too good (for the time being though).
Monday, May 09, 2005
Here's another interesting post about Memory Management in Windows.
https://blogs.msdn.com/slavao/archive/2005/01/29/363181.aspx
https://blogs.msdn.com/slavao/archive/2005/01/29/363181.aspx
Service Pack 4 for SQL Server 2000 has been released!
http://www.microsoft.com/sql/downloads/2000/sp4.asp
http://www.microsoft.com/sql/downloads/2000/sp4.asp
In case you guys don't know her already.
She is one of the absolute gurus in the obscure SQL Server world :-)
http://www.sqlskills.com/blogs/kimberly/
Her blog isn't updated on a daily basis but when she updates it you can be sure that it's very usefull information.
Wednesday, May 04, 2005
I was trying to determine whether I had put all of my tables on the correct filegroup and I wanted to list this. I came up with the following query to quickly list all the needed information.
SELECT o.Name as 'Table Name', g.GroupName
FROM sysobjects o
JOIN sysindexes i on i.id = o.id
JOIN sysfilegroups g on g.groupid = i.groupid
SELECT o.Name as 'Table Name', g.GroupName
FROM sysobjects o
JOIN sysindexes i on i.id = o.id
JOIN sysfilegroups g on g.groupid = i.groupid
A lot of people tend to use DBCC FREEPROCCACHE when they are performance testing procedures. This is obviously a very good habit, however, when sharing a server with other databases you are clearing the cache for all databases. You can prevent this by using DBCC FLUSHPROCINDB(dbid) which only clears the cache for a specific database.
Tuesday, May 03, 2005
Found this old but yet very useful article in SQL Server Magazine (InstantDoc 40925).
It is an in depth study of DBCC SQLPERF (WAITSTATS) with a lot of information on what to monitor.
There are a couple of interesting formulas in the article that came to my attention.
Initial Compiles(%) = (SQL Compilations/sec - SQL Recompilations/sec) / Batch Requests/sec
Plan Reuse (%) = (Batch Requests/sec - Initial Compiles/sec) / Batch Requests/sec
To determine the optimal Packet Size use the following formula:
Average Number of Bytes per packet = Bytes Total/sec / Packets/sec
It is an in depth study of DBCC SQLPERF (WAITSTATS) with a lot of information on what to monitor.
There are a couple of interesting formulas in the article that came to my attention.
Initial Compiles(%) = (SQL Compilations/sec - SQL Recompilations/sec) / Batch Requests/sec
Plan Reuse (%) = (Batch Requests/sec - Initial Compiles/sec) / Batch Requests/sec
To determine the optimal Packet Size use the following formula:
Average Number of Bytes per packet = Bytes Total/sec / Packets/sec
Wednesday, April 27, 2005
In our journey for new questions to ask on an interview I came up with an interesting question. Although it is not too difficult there are not too many people who really know the difference between DELETE (without WHERE) and TRUNCATE.
TRUNCATE is faster than DELETE is not a complete answer (although true), but what makes it faster.
DELETE removes the rows one at a time and records this in the transaction log. TRUNCATE removes them by deallocating the data and index pages and only this action is logged.
There are a couple of things to note though:
- If a foreign key references the table TRUNCATE will not work
- If the table is publishing data for replication TRUNCATE will not work
- Delete triggers are not fired
Many people believe that TRUNCATE is not logged, this is of course not true. You can use TRUNCATE in a transaction (try using it in a transaction and rollback that transaction).
TRUNCATE is faster than DELETE is not a complete answer (although true), but what makes it faster.
DELETE removes the rows one at a time and records this in the transaction log. TRUNCATE removes them by deallocating the data and index pages and only this action is logged.
There are a couple of things to note though:
- If a foreign key references the table TRUNCATE will not work
- If the table is publishing data for replication TRUNCATE will not work
- Delete triggers are not fired
Many people believe that TRUNCATE is not logged, this is of course not true. You can use TRUNCATE in a transaction (try using it in a transaction and rollback that transaction).
Wednesday, April 20, 2005
Friday, April 15, 2005
Hmmm very very weird behaviour :s
We have an Execute SQL task that calls a stored procedure containing xp_cmdshell to BCP out 2 tables and some other stuff. Somewhere after the export of the second one the step reports to be completed successfully although there are a couple commands that need to be executed after the BCP (in the same stored procedure).
Apparently - still investigating though - using NO_OUTPUT solves the problem
We have an Execute SQL task that calls a stored procedure containing xp_cmdshell to BCP out 2 tables and some other stuff. Somewhere after the export of the second one the step reports to be completed successfully although there are a couple commands that need to be executed after the BCP (in the same stored procedure).
Apparently - still investigating though - using NO_OUTPUT solves the problem
Subscribe to:
Posts (Atom)