Results 1 to 3 of 3

Thread: M$SQL:Stored Procedures - Executing Procedure in a Procedure? [Resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622

    Resolved M$SQL:Stored Procedures - Executing Procedure in a Procedure? [Resolved]

    Can i shorten sp_ArtistFromLyricID by executing sp_AlbumFromLyricID?


    Code:
    CREATE PROCEDURE sp_ArtistFromLyricID
    (
    	@LyricID			bigint
    )
    AS
    BEGIN
    
    	SELECT
    		Data_Artists.*, Data_Albums.*, Data_Songs.*, Data_Lyrics.*
    	FROM
    		Data_Artists INNER JOIN Data_Albums
    			ON Data_Artists.ArtistID = Data_Albums.ArtistID
    		INNER JOIN Data_Songs
    			ON Data_Albums.AlbumID = Data_Songs.AlbumID
    		INNER JOIN Data_Lyrics
    			ON Data_Songs.SongID = Data_Lyrics.SongID
    	WHERE
    		Data_Lyrics.LyricID = @LyricID
    END
    GO
    Code:
    CREATE PROCEDURE sp_AlbumFromLyricID
    (
    	@LyricID			bigint
    )
    AS
    BEGIN
    
    	SELECT
    		Data_Albums.*, Data_Songs.*, Data_Lyrics.*
    	FROM
    		Data_Albums
    		INNER JOIN Data_Songs
    			ON Data_Albums.AlbumID = Data_Songs.AlbumID
    		INNER JOIN Data_Lyrics
    			ON Data_Songs.SongID = Data_Lyrics.SongID
    	WHERE
    		Data_Lyrics.LyricID = @LyricID
    END
    GO
    Last edited by <ABX; Nov 19th, 2004 at 10:59 AM.
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width