How can we help you today? How can we help you today?

delete from - autocomplete not working correctly

hi there,

i have a sproc (which i will post below) where when i type DELETE FROM prompt instead of giving me a selection of tables instead seems to give me a selection of functions. It seems it has something to do with where the delete statement is located in the sproc since at one location it works and at another it doesnt. here is the code:
Create Procedure sp_DeleteMessage
	@messageid as int
AS
declare @layoutid as int
declare @userid as int
SELECT @layoutid = messages.laytoutid from Messages where messages.id = @messageid;
If (select templates.owner from templates where templates.id = @layoutid) = @userid 
	begin
	Delete from templates where templates.id = @layoutid
	Delete from layouts where layouts.id = @layoutid
	Delete from templatelayouts where layoutid = @layoutid
	end
Delete from messages where messages.id = @messageid

If i type the delete statement inside the IF statement or right after the END statement, it gives me functions. If i type the delete statement after that last delete statement (or remove that one and insert a blank line) it then gives me tables when i type 'delete from'.

if this is due to an error on my part i apologize. I'm still very new to working with sproc's.

thanks
merk
0

Comments

2 comments

  • Bart Read
    Hi there,


    Thanks for reporting this. I don't think it's your fault at all. The parsing engine in the current version of SQL Prompt is very simplistic, so sometimes it gets confused about what should be popped up. We're completely rewriting this for SQL Prompt 3 so when that comes out you should find that this is fixed. Sorry I can't be more direct help right now.


    Many thanks,
    Bart Read
    0
  • merk
    ok thanks. at least i know i wasnt doing anything wrong :)
    merk
    0

Add comment

Please sign in to leave a comment.