Click here to Skip to main content
15,917,455 members
Home / Discussions / Database
   

Database

 
QuestionIntellisense not showing up in sqlserver 2008 Pin
Krishna Aditya10-Jul-09 3:59
Krishna Aditya10-Jul-09 3:59 
AnswerRe: Intellisense not showing up in sqlserver 2008 Pin
Manas Bhardwaj17-Jul-09 4:51
professionalManas Bhardwaj17-Jul-09 4:51 
GeneralRe: Intellisense not showing up in sqlserver 2008 Pin
Krishna Aditya19-Jul-09 20:38
Krishna Aditya19-Jul-09 20:38 
QuestionHow to Filter variables for SP, to return only one value from many in SQL View Pin
Krishna Aditya9-Jul-09 2:00
Krishna Aditya9-Jul-09 2:00 
AnswerRe: How to Filter variables for SP, to return only one value from many in SQL View Pin
Mycroft Holmes9-Jul-09 11:36
professionalMycroft Holmes9-Jul-09 11:36 
GeneralRe: How to Filter variables for SP, to return only one value from many in SQL View Pin
Krishna Aditya10-Jul-09 2:16
Krishna Aditya10-Jul-09 2:16 
GeneralRe: How to Filter variables for SP, to return only one value from many in SQL View Pin
Blue_Boy10-Jul-09 3:33
Blue_Boy10-Jul-09 3:33 
QuestionStored Proc Optimisation Pin
Paul Unsworth8-Jul-09 23:19
Paul Unsworth8-Jul-09 23:19 
Hi All.

I have a stored procedure which returns a set of records. I have an optional parameter in there, so the idea is the proc will return all records if the parameter is null, otherwise filter the results.
Code:
CREATE PROC sp_MyProc (@ItemID AS INT)
AS
BEGIN
   SELECT *
   FROM   myTable
   WHERE  ItemID LIKE CASE WHERE @ItemID IS NULL THEN '%' ELSE '%' + @ItemID END
END


Is there a more effient way of doing this without repeating the query with an IF statement? (My Actual query is quite lengthy, so repeating the code will be messy)

Thanks in advance Big Grin | :-D

oooo, the Jedi's will feel this one....

AnswerRe: Stored Proc Optimisation Pin
www.Developerof.NET9-Jul-09 0:17
www.Developerof.NET9-Jul-09 0:17 
GeneralRe: Stored Proc Optimisation Pin
Paul Unsworth9-Jul-09 0:21
Paul Unsworth9-Jul-09 0:21 
AnswerRe: Stored Proc Optimisation Pin
J4amieC9-Jul-09 0:51
J4amieC9-Jul-09 0:51 
GeneralRe: Stored Proc Optimisation Pin
Paul Unsworth9-Jul-09 22:07
Paul Unsworth9-Jul-09 22:07 
AnswerRe: Stored Proc Optimisation Pin
Jeremy Likness9-Jul-09 8:31
professionalJeremy Likness9-Jul-09 8:31 
GeneralRe: Stored Proc Optimisation Pin
J4amieC9-Jul-09 23:45
J4amieC9-Jul-09 23:45 
QuestionQuering Nested Data in a table Pin
24891288-Jul-09 22:36
24891288-Jul-09 22:36 
AnswerRe: Quering Nested Data in a table Pin
Mycroft Holmes9-Jul-09 1:45
professionalMycroft Holmes9-Jul-09 1:45 
GeneralRe: Quering Nested Data in a table Pin
David Skelly9-Jul-09 2:16
David Skelly9-Jul-09 2:16 
GeneralRe: Quering Nested Data in a table Pin
Mycroft Holmes9-Jul-09 11:26
professionalMycroft Holmes9-Jul-09 11:26 
AnswerRe: Quering Nested Data in a table Pin
Niladri_Biswas9-Jul-09 5:42
Niladri_Biswas9-Jul-09 5:42 
AnswerRe: Quering Nested Data in a table Pin
Henry Minute9-Jul-09 11:17
Henry Minute9-Jul-09 11:17 
AnswerRe: Quering Nested Data in a table Pin
hemant.kaushal10-Jul-09 3:05
hemant.kaushal10-Jul-09 3:05 
QuestionOk, I changed a setting in VS2008 table adapters... Pin
Nick Jacobs8-Jul-09 11:10
Nick Jacobs8-Jul-09 11:10 
JokeRe: Ok, I changed a setting in VS2008 table adapters... Pin
Mycroft Holmes9-Jul-09 1:50
professionalMycroft Holmes9-Jul-09 1:50 
GeneralRe: Ok, I changed a setting in VS2008 table adapters... Pin
Nick Jacobs9-Jul-09 2:08
Nick Jacobs9-Jul-09 2:08 
Questionproblem getting text from a database table cell Pin
LucBite7-Jul-09 22:56
LucBite7-Jul-09 22:56 

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.