/* declare @userName varchar(20), @userPassword varchar(20), @appId varchar(30) set @userName = 'EDDY' set @userPassword = 'elaw' set @appId = 'ORCHID_TRACKING' */ select * from [Green Circle Growers$Remote App_ User] a (nolock) , [Green Circle Growers$Remote App_ Authorization] b (nolock) where a.[User Name] = b.[User Name] and a.[User Name] = @userName and a.[Password] = @userPassword and b.[App ID] = @appId