ColdFusion Question:
Download Questions PDF

How would you write a simple stored procedure in TSQL which takes a movie_id and returns all the directors associated with it?

Answer:

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE procedure [dbo].getDirector (
@movie_id INT
)

SELECT name FROM directors WHERE movie_id = @movie_id

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

Download ColdFusion Interview Questions And Answers PDF

Previous QuestionNext Question
What are the advantages and disadvantages of using stored procedures versus calling SQL inline in Cold Fusion?If there are no indices defined on any of the columns in the above two tables, which columns would you index to speed up the LEFT JOIN query?