Table information – column lengths, counts and unique counts
11 month ago
in Transact-SQL
Hi.
The Transact-SQL script below returns the following information:
ID – Just an identity column used within the script
SchemaName – The name of the schema
TableName – Obviously, the name of the table
ColumnName
Type – The data type of the column
Length – The maximum number of bytes used by the [...]
Endeca Upgrade (5.1.3 to 6.1.4A)
06 months ago
in Endeca
Over the past month or so, I have been working on upgrading an Endeca system that currently processes about 150,000 records. The current system runs on Endeca MDEX Engine v5.1.3. The latest version at the time of writing this post, is 6.1.4A.
I decided to work on a VirtualBox Virtual machine, [...]
Return the MAX of all dates within all tables within all databases
09 months ago
in General, Transact-SQL
I wanted to produce a list of the MAX of date fields (DateTime, SmallDateTime, TimeStamp) for all tables within all databases held in an instance of SQL Server.
The script below was written for SQL Server 2000, but should be easily customisable for SQL Server 2005
As always, please ensure you test [...]
Installing Virtual PC for Windows 7
010 months ago
Yesterday, I was trying to install Virtual PC for Windows 7, but it was taking ages to install. I even left it running overnight, but all it said, was:
Initializing installation... done!
Installing Update for Windows (KB958559) (update 1 of 1)...
I have just found this forum post that suggests [...]
Detach, Move, and re-Attach database
011 months ago
The Transact-SQL Script below, is useful if you want to standardise the location of your databases. I have been managing a server whereby databases created by other people were created all over the place!! Therefore, this script was written to make life so much easier.
Be sure to read through [...]
Maintenance Plan Error “Server: Msg 22029, Level 16, State 1, Line 0 sqlmaint.exe failed.”
112 months ago
in General
Earlier today, I discovered that the database maintenance plan on one of our SQL Server machine wasn’t working. When I reviewed the logs, it simply said “sqlmaint.exe failed”.
I ran the following command (copied from the SQL Server Agent job) using Query Analyzer (as this was a SQL Server 2000 [...]
Endeca: How do you show all dimension values even if no results will be returned?
01 year ago
in Endeca
Hi.
I have a .NET web site using Endeca, that references a three-level externally managed dimension.
An example of this dimension is:
Level 1: Dairy free, meat free, gluten free
Level 2: Meat free
Level 3: Tofu
Level 2: Dairy free
…
However, because there are no results for Meat [...]
Top most used query plans that are cached by SQL Server for faster query execution
01 year ago
in Transact-SQL
The query below, returns the top 20 most used query plans that are cached by SQL Server for faster query execution.
For more information regarding the dynamic management view, please see “sys.dm_exec_cached_plans (Transact-SQL)” in Books Online.
SELECT TOP 20
CASE cp.objtype
WHEN [...]