October 16, 2014 at 6:08 am
Hi yesterday i was trying to create Stored procedure but it fails i don't know why
CREATE proc GetBooksbyBorrowerID @Borrower_id INT
AS
BEGIN
SELECT A.BORROWER_ID ,a.ISBN, b.book_Title,b.LANGUAGE, CONVERT(VARCHAR,a.borrowed_from_date,103)"Borrowed On(dd/mm/yyyy)" FROM borrower_details a, book_mst b
WHERE a.borrower_id=@Borrower_id
AND a.ISBN = b.ISBN
END
GO
EXEC SP_Task1 10001
Can anybody help?
SSMS Expert
October 16, 2014 at 6:14 am
1) You're calling a different stored procedure (SP_Task1) from the one you've just created (GetBooksbyBorrowerID).
Edit: must learn to read.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 16, 2014 at 6:18 am
Sorry for that I also tried it with same procedure name
SSMS Expert
October 16, 2014 at 6:19 am
Execute GetBooksbyBorrowerID
SSMS Expert
October 16, 2014 at 6:25 am
Elliswhite (10/16/2014)
Execute GetBooksbyBorrowerID
We're not mindreaders around here - did the procedure fail to create, run with an error, run but fail to generate results...?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 16, 2014 at 6:35 am
Elliswhite (10/16/2014)
Execute GetBooksbyBorrowerID
Where's the parameter?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 16, 2014 at 6:44 am
Can you tell me how to define parameter?
SSMS Expert
October 16, 2014 at 6:49 am
Define a parameter, or pass a parameter? Since you do both in your first post, I don't understand why you're asking.
Quote from your very first post (parameter definition in bold).
CREATE proc GetBooksbyBorrowerID @Borrower_id INT
AS
BEGIN
SELECT A.BORROWER_ID ,a.ISBN, b.book_Title,b.LANGUAGE, CONVERT(VARCHAR,a.borrowed_from_date,103)"Borrowed On(dd/mm/yyyy)" FROM borrower_details a, book_mst b
WHERE a.borrower_id=@Borrower_id
AND a.ISBN = b.ISBN
END
GO
And another quote from your own post, passing a parameter
EXEC SP_Task1 10001
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 16, 2014 at 6:53 am
I also tried it with passing paremeter but still facing syntax error
SSMS Expert
October 16, 2014 at 6:56 am
Elliswhite (10/16/2014)
I also tried it with passing paremeter but still facing syntax error
Can you share the syntax error?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 16, 2014 at 6:58 am
.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 16, 2014 at 6:59 am
Ya sure i attached a snapshot of it. But in this i tried by changing name of stored procedure
SSMS Expert
October 16, 2014 at 7:00 am
Look at the very first red underline in that screen shot (on the very first line), that's your problem.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 16, 2014 at 7:02 am
GilaMonster (10/16/2014)
Look at the very first red underline in that screen shot (on the very first line), that's your problem.
Also, the name of the stored procedure.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 16, 2014 at 7:17 am
Sir please help me to correct it
SSMS Expert
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply