# Why is this format of stored procedure not working?

**URL:** <https://forum.codewithmosh.com/t/why-is-this-format-of-stored-procedure-not-working/15409>\
**Category:** SQL\
**Created:** [September 24, 2022, 8:43pm UTC](https://forum.codewithmosh.com/t/why-is-this-format-of-stored-procedure-not-working/15409 "2022-09-24T20:43:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erillman](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@Erillman](https://forum.codewithmosh.com/u/Erillman)\
**Post date:** [September 24, 2022, 8:43pm UTC](https://forum.codewithmosh.com/t/why-is-this-format-of-stored-procedure-not-working/15409/1 "2022-09-24T20:43:33Z")

</div>

![sql question](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/d/d87903e9f299d32494964eab4521d38d5d0bd6ea.png)  
It doesn’t even detect the first format and just runs “USE sql\_invoicing;”

What’s going on?

---

<div class="post-metadata">

**Author:** ![northernocean](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@northernocean](https://forum.codewithmosh.com/u/northernocean)\
**Post date:** [September 26, 2022, 1:25am UTC](https://forum.codewithmosh.com/t/why-is-this-format-of-stored-procedure-not-working/15409/2 "2022-09-26T01:25:33Z")

</div>

Syntax looks okay. I would suggest you post only the code of the stored procedure that isn’t working, and try it in a file by itself. This is because it is hard to tell if this error is actually from the code you think it is from or maybe from somewhere else (it looks like you have thousand+ lines in the file, and even the same stored procedure in there twice - too many opportunities for errors when you have so much code running at once).
