Forum Posts

Memory Leak in For Loop Container?

Today, as I was working on a project, I found an opportunity to use the For Loop Container. The basic setup, was three tables, A, B, C for simplicity.

Table A is the Header, Table B a sub-header related to table A via an ID, and Table C related to Table B via an id. [...]

SQL SIG

Just wanted to extend a warm welcome to anyone finding our site after last night’s presentation. It was a great experience for us and we hope that we can continue to grow our community. I realize the site needs a lot of work, so please bear with us as we continue to improve it to [...]

GROUP BY CUBE example

The GROUP BY CUBE statement is pretty sweet. Here’s an example.

First, let’s create our table and add data:

IF EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N’[dbo].[GroupByCubeExample]‘)
AND type in (N’U'))
DROP TABLE [dbo].[GroupByCubeExample]
GO

CREATE TABLE [dbo].[GroupByCubeExample](
[Region] [nvarchar](50) NOT NULL,
[Product] [nvarchar](50) NOT NULL,
[Salesman] [nvarchar](50) NOT NULL,
[Amount] [money] NOT NULL
)
GO

INSERT INTO dbo.GroupByCubeExample
(Region,Product,Salesman,Amount)
SELECT ‘America’,'Bike’,'Bean, Adam’,10
UNION ALL SELECT ‘America’,'Bike’,'Stanford, Matt’,20
UNION [...]

Generating a Date Dimension the easy way

While there are different views on how to build different dimensions, there seems to be a common view of how, at least the basic information, of date dimensions looks. This can take a little time to build out. To help in building this dimension, I created a simple table valued function that takes in a [...]

An alternative to triggers

As we all know, and some of us hate, triggers are not the best thing for performance. Enter SQL 2005+ with the Output clause.

Here is the scenario. You have a table that is transactional. You only care about the most recent record for your system, but need to have historical data available for reporting and/or [...]

Forum is now available

Lots of work to do to create additional forums, but for now it’s a start. For those of you who find us and want to ask questions about the admin database, DBACentral or general administration, this is a great place to do it. Give us time and the forum will evolve, for now though, it’s [...]

admin database objects and utility publically available!

The official release to the public is now available on the admin database page.

We are working to have documentation ready as soon as possible. In the mean time, feel free to download and review/use the objects.

Thanks

DBCC CHECKDB with readonly filegroups

I can’t believe this. I’ve got a large (2+ TB) database that I want to do daily integrity checks on. Because it is so big, I was using PHYSICAL_ONLY. Here’s the command:

DBCC CHECKDB(BigDB) WITH PHYSICAL_ONLY, TABLERESULTS, NO_INFOMSGS, ALL_ERRORMSGS

I very quickly get this error:

Msg 5030, Level 16, State 12, Line 1 The database [...]

Work-around for 2005 Maintenance Plan bug

In working with SQL 2005 Maintenance Plan backup cleanup tasks, a frustrating bug was found.  It seems that when the ability to select “hours” as a time criterion was added in SP2, the door was opened for misinterpretation of time units.  For example, you can, in your local Management Studio, set the Plan to delete [...]

“Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created.”

Management Studio 2008 has a default that prevents saving table changes from the designer when the table will need to be rebuilt.  I’m constantly being asked about this error by developers:

 ”Saving changes is not permitted.  The changes you have made require the following tables to be dropped and re-created.”

 To be able to make table changes [...]

Page 1 of 212