If we run the query below with the values of 'rml' and 'ra' it runs but if we use 'cca' and 'cc' we get this error:

Server: Msg 1101, Level 17, State 10, Line 8
Could not allocate new page for database 'TEMPDB'. There are no more pages available in filegroup DEFAULT. Space can be created by dropping objects, adding additional files, or allowing file growth.

Here is the query

Declare @Level_1 varchar(3),
@Level_2 varchar(2)

Select @Level_1 = 'cca'
Select @Level_2 = 'cc'

select distinct tblAsset.State, tblAsset.County, tblAsset.Plant, tblAsset.Account,
tblAsset.Acq_Yr, tblAsset.Acq_Pd, tblAsset_Book.Cost_Original,
tblCounty_Names.County_Name, CER..tblLocation.Location,
tblGL_Account.Account_Desc

from tblAsset, tblAsset_Book, tblCounty_Names, CER..tblLocation, tblGL_Account
where tblAsset_Book.Level_1 = @Level_1
and tblAsset.Level_1 = tblAsset_Book.Level_1
and tblAsset_Book.Level_2 = @Level_2
and tblAsset.Level_2 = tblAsset_Book.Level_2
and tblGL_Account.Company = tblAsset.Level_2
and CER..tblLocation.SBU = tblGL_Account.Company
and tblCounty_Names.County = tblAsset.County
and CER..tblLocation.County = tblCounty_Names.County
and CER..tblLocation.Code = tblAsset.Plant
and tblGL_Account.Account = tblAsset.Account
and tblAsset_Book.Book_Number = '1'
order by tblAsset.State