sp_MSForEachDB 'IF ''?'' LIKE ''%%02_Def'' 
BEGIN

USE [?]

UPDATE [dbo].[tblDtsFields] SET [tOrigCaption]=''State'' WHERE [tName]=''nStateID'' AND [nRelationshipType]=-1;
UPDATE [dbo].[tblDtsFields] SET [tOrigCaption]=''ID'' WHERE [tName]=''nID'' AND [nRelationshipType]=-1;

END
'

--------------------------------------------
USE [Users_mdb];


UPDATE [dbo].[tblDtsFields] SET [tOrigCaption]='State' WHERE [tName]='nStateID' AND [nRelationshipType]=-1;
UPDATE [dbo].[tblDtsFields] SET [tOrigCaption]='ID' WHERE [tName]='nID' AND [nRelationshipType]=-1;

GO


