Archive for July, 2008
Nissan Skyline comes to the USA
0I am by no means a car enthusiast, or junkie. I know nothing of rebuilding engines, and can’t even drive a manual. But there are a few vehicles that do make me… swoon, shall we say. One of those I’ve written about before is the Nissan Skyline GT-R. A legend among sports cars.
Well, Nissan have finally seen fit to bring them to America. Exciting news :)
SQL Query contraints of a database
1Another useful query I was in need of, and found, yesterday. This one is care of Pinal Dave (who writes a very useful blog, which has helped me before), though I added the “Order By” line. This query lists all the constraints of a database. Replace AdventureWorks with your DB name.
USE AdventureWorks;
GO
SELECT OBJECT_NAME(OBJECT_ID) AS NameofConstraint,
SCHEMA_NAME(schema_id) AS SchemaName,
OBJECT_NAME(parent_object_id) AS TableName,
type_desc AS ConstraintType
FROM sys.objects
WHERE type_desc LIKE ‘%CONSTRAINT’
ORDER BY NameofConstraint
GO
Visit to Toronto, in September and October
0I just booked flights for Maija and I to visit Toronto later this year. We’ll be there from September 26th till October 28th! It’ll be oh so lovely. We’ll be staying in the Etobicoke area, to allow me convenient access to work.
Exciting :)
Query a MSSQL database for table sizes
2We use Microsoft SQL 2005 for our mission critical and web databases. In one instance, we’re able to use SQL Express just fine, but lately I had been keeping an eye on a DB that was approaching the 4GB limit imposed on SQL Express. I had a Google for queries to list the table sizes (it’s simple enough to find out the size of a single table in Management Studio, but querying is clearly simpler/faster). I found exactly what I was looking for, thanks to Scott Moss. Paste this below, replacing OnePoint with your DB name. Everything else is fine as is.
– 12/16/2007
– Any DB will show the table size in MegaBytes
– worked with a SQL Guru at M$ for a few hours last week, here are some fruits of mostly his labor
Use OnePoint
Goselect object_name(id) [Table Name],
[Table Size] = convert (varchar, dpages * 8 / 1024) + ‘MB’from sysindexes where indid in (0,1)
order by dpages desc– Have A great Week!
Thank you Scott Moss!
Recent Comments