Click here to Skip to main content
15,902,918 members
Home / Discussions / Database
   

Database

 
GeneralRe: Error In Query: Pin
Shahzad.Aslam6-Feb-07 20:49
Shahzad.Aslam6-Feb-07 20:49 
AnswerRe: Error In Query: Pin
Colin Angus Mackay6-Feb-07 22:21
Colin Angus Mackay6-Feb-07 22:21 
AnswerRe: Error In Query: Pin
Vsree7-Feb-07 0:05
Vsree7-Feb-07 0:05 
QuestionRetrieving data from multiple databases Pin
Malayil alex6-Feb-07 17:56
Malayil alex6-Feb-07 17:56 
AnswerRe: Retrieving data from multiple databases Pin
gauthee6-Feb-07 18:53
gauthee6-Feb-07 18:53 
QuestionFilling a typed dataset Pin
steve_rm6-Feb-07 16:02
steve_rm6-Feb-07 16:02 
AnswerRe: Filling a typed dataset Pin
M.H.1.2.37-Feb-07 17:50
M.H.1.2.37-Feb-07 17:50 
QuestionUsing parameter on Query condition not working Pin
firestoper6-Feb-07 15:46
firestoper6-Feb-07 15:46 
Hi Guru's
I created a stored procedure which on a straight query it will appear like this

select BookTitle, Author, Status from LibBooks where Author like '%Buck%'

On my SP I created two @parameters to have flexibility on my query, @SearchCategory - column name (Author)
@SearchField - text to be searched (Buck)

Problem:
I noticed that my query does'nt return result, its it possible to use @parameter as substitute to column name on a condition?

Something like this:
select BookTitle, Author, Status from LibBooks where @SearchCategory like '%' + @SearchField + '%'

SP that I created
Create procedure [dbo].[sp_searchFromCat]
(
@SearchCategory varchar(100) = null,
@SearchField varchar (100) = null
)
as
begin

select
BookTitle,
Author,
Status
from
LibBooks
where

@SearchCategory like '%' + @SearchField + '%'
end
AnswerRe: Using parameter on Query condition not working Pin
M.H.1.2.36-Feb-07 16:49
M.H.1.2.36-Feb-07 16:49 
GeneralRe: Using parameter on Query condition not working Pin
firestoper6-Feb-07 18:17
firestoper6-Feb-07 18:17 
AnswerRe: Using parameter on Query condition not working Pin
gauthee6-Feb-07 17:29
gauthee6-Feb-07 17:29 
GeneralRe: Using parameter on Query condition not working Pin
firestoper11-Feb-07 21:16
firestoper11-Feb-07 21:16 
QuestionQuery Help Pin
Hulicat6-Feb-07 15:11
Hulicat6-Feb-07 15:11 
AnswerRe: Query Help Pin
M.H.1.2.36-Feb-07 16:58
M.H.1.2.36-Feb-07 16:58 
GeneralRe: Query Help Pin
Hulicat6-Feb-07 17:25
Hulicat6-Feb-07 17:25 
QuestionSQL parameters and datatypes Pin
sojumonk6-Feb-07 14:16
sojumonk6-Feb-07 14:16 
AnswerRe: SQL parameters and datatypes Pin
Kschuler7-Feb-07 10:37
Kschuler7-Feb-07 10:37 
QuestionHelp required in query formation Pin
www.Developerof.NET6-Feb-07 5:50
www.Developerof.NET6-Feb-07 5:50 
AnswerRe: Help required in query formation Pin
andyharman6-Feb-07 7:54
professionalandyharman6-Feb-07 7:54 
QuestionProblem connecting to remote SQL Express 2005 Pin
Joe Smith IX6-Feb-07 5:02
Joe Smith IX6-Feb-07 5:02 
AnswerRe: Problem connecting to remote SQL Express 2005 Pin
Rob Graham6-Feb-07 5:19
Rob Graham6-Feb-07 5:19 
AnswerRe: Problem connecting to remote SQL Express 2005 Pin
Mark Salsbery6-Feb-07 16:46
Mark Salsbery6-Feb-07 16:46 
AnswerRe: Problem connecting to remote SQL Express 2005 Pin
Joe Smith IX15-Feb-07 2:02
Joe Smith IX15-Feb-07 2:02 
QuestionError : "Operation must use an updateable query" Pin
RedhaDev6-Feb-07 1:42
RedhaDev6-Feb-07 1:42 
AnswerRe: Error : "Operation must use an updateable query" Pin
Bassam Saoud6-Feb-07 1:45
Bassam Saoud6-Feb-07 1:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.