Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Inefficient statement causing issues

$
0
0

I am running this query, I believe my SQL statement is causing to much overhead and causing the 'System.OutOfMemoryException'. Please advice what I could do instead of performing this complex lookup statement or how I can improve this lookup statement.  Thanks

SELECT
  tblAsset.AssetID
  ,tblAsset.SiteID
  ,tblAsset.OrderNumber
  ,tblAsset.AssetCategoryID
  ,tblAsset.DepartmentID
  ,tblAsset.VendorID
  ,tblAsset.ModelNumber
  ,tblAsset.SerialNumber
  ,tblAsset.ComputerName
  ,tblAsset.HardwareNumber
  ,tblAsset.AssetLabel
  ,tblAsset.DateRecieved
  ,tblAsset.Checked
  ,tblAsset.Comments
  ,tblAsset.DateInstalled
  ,tblAsset.ItemScrapped
  ,tblAsset.DateScrapped
  ,tblAsset.JobNumber
  ,tblAsset.RequistionNumber
  ,tblAsset.InstalledBy
  ,tblAsset.ReplacingAsset
  ,tblAsset.TrustID
  ,tblAsset.Name
  ,tblAsset.IMEInumber
  ,tblAsset.Phonenumber
  ,tblAsset.Scrappedby
  ,tblAsset.HarddriveSerial
  ,tblAsset.NewInstall
  ,tblAsset.Encrypted
  ,tblAsset.BERPaperworkReceived
  ,tblAsset.DateChecked
  ,tblAsset.LPT_FAM
  ,tbllookupTrusts.Trust
  ,tbllookupCat_Ven.AssetCategory
  ,tbllookupSites.SiteName
  ,tbllookupCat_Ven.Vendor
  ,tbllookupDepartments.DepartmentName
  ,tbllookupTechnicians.Techname
FROM
  tblAsset
  INNER JOIN tbllookupTrusts
    ON tblAsset.TrustID = tbllookupTrusts.TrustID
  INNER JOIN tbllookupCat_Ven
    ON tblAsset.AssetCategoryID = tbllookupCat_Ven.CatID
  LEFT OUTER JOIN tbllookupSites
    ON tblAsset.SiteID = tbllookupSites.SiteID
  LEFT OUTER JOIN tbllookupDepartments
    ON tblAsset.DepartmentID = tbllookupDepartments.DepartmentID
  LEFT OUTER JOIN tbllookupTechnicians
    ON tblAsset.InstalledBy = tbllookupTechnicians.TechID


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>