E-Mail:

Programming

Optimizing Transaction Logs

Welcome back and Happy Saturday!
Today I wanted to share with you that some DBAs seem to overlook the transaction log when thinking about optimizing database performance.  I myself was guilty of not considering optimizing the transaction logs for my production databases.  I am going to blog about Virtual Log Files (VLFs) and why it is important [...]

Fixing Orphaned Users In SQL Server 2005

The other day i restored a QA database in compatibility level 90 (SQL Server 2005) to a production server that had SQL Server 2005 installed.  The restore went as expected however, the logins that were already there on the SQL Server had different SIDs than the users in the database that was restored.  We maintain three [...]

Querying DTS Tables For Log Information

Today I was looking the SQL Server Agent jobs on one of my SQL Server 2000 production database servers.  I noticed one job that failed with a very cryptic error.  This was the error message reported:
DTSRun OnStart:  DTSStep_DTSDataPumpTask_6   DTSRun OnProgress:
DTSStep_DTSDataPumpTask_6; 1000 Rows have been transformed or copied.;
PercentComplete = 0; ProgressCount = 1000   DTSRun OnProgress:
DTSStep_DTSDataPumpTask_6; 2000 [...]

Black Box Trace In SQL Server

The other day I was looking on a production SQL Server and I noticed a trace file that was running but was not able to associate it to SQL Profile session. I queried sysprocesses and was unable to find a spid that was running SQL Profile. I was perplexed for a little while and started [...]

Inserting DBCC CHECKDB Results Into A Table

Hello again and welcome back!
I thought today’s posting to my blog should cover how to get the results of DBCC CHECKDB into a table.  Unfortunately, Microsoft does not allow you easily per se to insert the results into a table so that you might be able to generate administrative reports off of.  Well in my [...]

Using Double Quoted Identifiers In Linked Servers

The other day I was trying to obtain connection information from master.dbo.sysprocesses via a linked server call using SQL Server 2005. So the statement I was running looked like this:

INSERT INTO connection
SELECT DISTINCT [name],
hostname,
program_name,
loginame,
nt_username,
net_address,
last_batch, 
getdate()
FROM OPENQUERY(”SQL1\V01″, ‘SELECT d.[name], p.hostname, p.program_name, p.loginame, p.nt_username, p.net_address, p.last_batch, getdate() FROM master.dbo.sysprocesses as p inner join master.dbo.sysdatabases as d on p.dbid = d.dbid‘)

When I execute the insert\select statement it works in [...]

Bug with db_name?

The other day I was pulling data from the sysprocesses table on a remote SQL Server 2000 server. I was on a database server that has SQL Server 2005 Service Pack 2 on it and I have the destination (remote) SQL Server 2000 setup as a linked server on the SQL Server 2005 server. With [...]

Better Ways To Monitor SQL Server 2005!

The other day I found myself looking at new\different ways to monitor the health of my production SQL Server 2005 servers. I thought that there must be a better way to monitor in SQL Server 2005 than in SQL Server 2000. So as I was looking through books online and perusing the internet [...]

How To Calculate If Hour Is Even Or Odd In T-SQL..

Hello there…
Today is going to be a short posting on how to calculate whether or not the hour in either the function getdate() or a datetime field in a table is either even or odd. I am using this to determine which tables (evenhour or oddhour) are recording page impressions. Here is the T-SQL script:  select datepart(hour,getdate())%2 [...]

How To Turn Imported XML Into A Relational Format in SQL Server 2005..

Welcome back!
I hope you found my how to import XML into SQL Server 2005 helpful. Today I thought we would take a step further and turn that imported XML file into a relational format\table. In my previous post you created a table via T-SQL taht contais a field called xml_data with a data [...]

23 queries / 0.272 seconds.