# Find Shelf Locations tied to Item Templates

**URL:** https://forum.innovativeusers.org/t/find-shelf-locations-tied-to-item-templates/2414
**Category:** Polaris Repository
**Created:** [April 4, 2025, 6:11pm UTC](https://forum.innovativeusers.org/t/find-shelf-locations-tied-to-item-templates/2414 "2025-04-04T18:11:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![wesochuck](https://forum.innovativeusers.org/user_avatar/forum.innovativeusers.org/wesochuck/32/499_2.png) [@wesochuck](https://forum.innovativeusers.org/u/wesochuck)
#### Post date: [April 4, 2025, 6:11pm UTC](https://forum.innovativeusers.org/t/find-shelf-locations-tied-to-item-templates/2414/1 "2025-04-04T18:11:36Z")

</div>

You cannot delete Shelf Locations if they are being used in item templates. This SQL will show you which item templates are using which Shelf Locations for a particular LIBRARY (not BRANCH) orgid.

```auto
SELECT
    it.ItemTemplateID as templateid,
	it.name AS templatename,
    sl.Description AS shelflocation
FROM
    Polaris.polaris.ItemTemplates it
JOIN
    polaris.Polaris.ShelfLocations sl ON sl.ShelfLocationID = it.ShelfLocationID
JOIN
	polaris.polaris.Organizations orgs on orgs.OrganizationID = sl.OrganizationID
WHERE
	orgs.ParentOrganizationID = 6 and ---enter LIBRARYID here
	sl.OrganizationID = it.AssignedBranchID
ORDER BY
    sl.Description

```

You can also use this Item Template **Find Tool SQL** to find all templates where the Shelf Location matches a particular description:

```auto
SELECT ItemTemplateID from polaris.polaris.ItemTemplates
where ShelfLocationID in (
select ShelfLocationID from polaris.polaris.ShelfLocations where Description like '%Easter%')

```

---

<div class="post-metadata">

### Author: ![bgaydos](https://forum.innovativeusers.org/user_avatar/forum.innovativeusers.org/bgaydos/32/1045_2.png) [@bgaydos](https://forum.innovativeusers.org/u/bgaydos)
#### Post date: [April 4, 2025, 6:30pm UTC](https://forum.innovativeusers.org/t/find-shelf-locations-tied-to-item-templates/2414/2 "2025-04-04T18:30:56Z")

</div>

Hi @wesochuck.&nbsp; Noting the two approaches and not knowing anything about the Polaris Find Tool, does its version of SQL not support joins?&nbsp; Just a matter of casual interest; reply at your leisure, thanks.

---

<div class="post-metadata">

### Author: ![wesochuck](https://forum.innovativeusers.org/user_avatar/forum.innovativeusers.org/wesochuck/32/499_2.png) [@wesochuck](https://forum.innovativeusers.org/u/wesochuck)
#### Post date: [April 4, 2025, 6:32pm UTC](https://forum.innovativeusers.org/t/find-shelf-locations-tied-to-item-templates/2414/3 "2025-04-04T18:32:02Z")

</div>

It does support joins (there are other limitations), but my laziness and poor SQL skills know no bounds 😉 One part of it was from something we “developed” years ago.
