HMcompfreak
HMcompfreak

Reputation: 171

Select query not retrieving records when executed in stored procedure

I am having a doubt, can anyone please explain me why I am getting record in select query but not able to get the same when the query is executed from a stored procedure

Below ,select query retrieving records enter image description here

and here no records for the same query in stored procedure

enter image description here

Upvotes: 0

Views: 139

Answers (2)

Deepshikha
Deepshikha

Reputation: 10264

As pointed out the name is more than varchar(25) and same may hold true for other values of mnthname as well. So alter funciton definition as:

Alter proc FindsSring
(
@name varchar(max),
@STD varchar(10),
@Div varchar(2),
@month varchar(100)
)
As ...

Upvotes: 0

Magnus
Magnus

Reputation: 46919

It seems your @name parameter of type varchar(25) is to small to fit the example name in the query. It would be truncated and the query would give no result.

Upvotes: 1

Related Questions