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
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:
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