Hi -
Is there a way to keep the DB scope when using INFORMATION_SCHEMA views? I
currently construct a string using DB_NAME() for full naming convention and
execute that.
The following system SP illustrates the problem:
CREATE PROCEDURE sp_a
AS
SET NOCOUNT ON
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
ORDER BY 1
SELECT name
FROM sysobjects
WHERE type = 'U'
ORDER BY 1
'SELECT TABLE_NAME
WHERE TABLE_TYPE = ''BASE TABLE''
ORDER BY 1'
SET NOCOUNT OFF
GO