KDASQL (10/8/2008)
Getting this error when I run this script in sql 2000:
Server: Msg 208, Level 16, State 1, Line 4
Invalid object name 'Tempdb.sys.objects'.
This is happening because there is no sys.objects in SQLServer 2000
Replace the first IF statement with this, it wil work:
IF LEFT(CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(1)),1) = '9'
IF EXISTS (
SELECT TOP 1 *
FROM Tempdb.sys.objects (nolock)
WHERE name LIKE '#TUser%')
DROP TABLE #TUser
ELSE IF LEFT(CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(1)),1) = '9'
IF EXISTS (
SELECT TOP 1 *
FROM Tempdb.dbo.sysobjects (nolock)
WHERE name LIKE '#TUser%')
DROP TABLE #TUser
Apologise for this over look. I dont have a SQL 2000 instance for testing.
Kindest Regards,
Shivaram Challa
(http://challa.net - Home of the "Excel to CSV converter & Browsepad applications".)
Forum Etiquette: How to post data/code on a forum to get the best help[/url]