Click here to Skip to main content
15,887,596 members
Home / Discussions / Database
   

Database

 
QuestionADV ICE WANTED!! Pin
jaygreen928-Oct-05 8:59
jaygreen928-Oct-05 8:59 
AnswerRe: ADV ICE WANTED!! Pin
Colin Angus Mackay28-Oct-05 13:19
Colin Angus Mackay28-Oct-05 13:19 
QuestionProblem with working SQL Server SAVE POINTS in Transactions. Pin
farhan197627-Oct-05 20:11
farhan197627-Oct-05 20:11 
QuestionTriggers and transaction context. Pin
devvvy27-Oct-05 6:15
devvvy27-Oct-05 6:15 
AnswerRe: Triggers and transaction context. Pin
Farhan Noor Qureshi27-Oct-05 9:21
Farhan Noor Qureshi27-Oct-05 9:21 
GeneralRe: Triggers and transaction context. Pin
devvvy27-Oct-05 13:49
devvvy27-Oct-05 13:49 
QuestionDatabase 'foodmart 2000' does not exist Pin
kuldeep_kumar27-Oct-05 5:25
kuldeep_kumar27-Oct-05 5:25 
QuestionDynamic procedures, are they possible? Pin
FruitBatInShades27-Oct-05 3:59
FruitBatInShades27-Oct-05 3:59 
Please excuse my ignorance but I'm new to T-SQL and am having a problem. I have a proc that I want to send three parameters too, but only have it search on the paramters if they are valid (above 0).
In the following example I am filtering on County, Town and Type. But only want to filter if the value of the parameter is included. So if they only pass in county, then thats all I want to filter on.

Any ideas?
<br />
CREATE PROCEDURE FeatureBusinessByTown @County int, @Town int, @Type int AS<br />
<br />
Select Top 5 BusinessID<br />
FROM SELECT TOP 5 fbisBusinessLookup.BusinessID<br />
 FROM fbisBusinessLookup INNER JOIN<br />
 DIRECTORY ON fbisBusinessLookup.BusinessID = directory.[id]<br />
 WHERE <br />
<br />
IF (@county > 0) THEN "(fbisBusinessLookup.countyid = @County)"<br />
IF (@Town > 0) THEN " AND fbisBusinessLookup.TownID = @Town"<br />
IF (@Type>0) THEN " AND fbisBusinessLookup.TypeID = @Type"<br />
<br />
 ORDER BY NEWID()) DERIVEDTBL<br />
GO<br />


Definitely a PEBCAK! (Problem Exists Between Keyboard And Chair)
www.FruitBatInShades.com
AnswerRe: Dynamic procedures, are they possible? Pin
Colin Angus Mackay27-Oct-05 6:31
Colin Angus Mackay27-Oct-05 6:31 
AnswerRe: Dynamic procedures, are they possible? Pin
codet28-Oct-05 16:28
codet28-Oct-05 16:28 
QuestionProblems inserting data in database with datagrid Pin
wappi_berlin27-Oct-05 1:44
wappi_berlin27-Oct-05 1:44 
QuestionExcluding some fields from a table in a datagrid Pin
odrap26-Oct-05 0:24
odrap26-Oct-05 0:24 
AnswerRe: Excluding some fields from a table in a datagrid Pin
Edbert P26-Oct-05 12:50
Edbert P26-Oct-05 12:50 
QuestionInsert Data via Stored procedure by ado.net Pin
thedom225-Oct-05 23:33
thedom225-Oct-05 23:33 
AnswerRe: Insert Data via Stored procedure by ado.net Pin
Edbert P26-Oct-05 12:52
Edbert P26-Oct-05 12:52 
GeneralRe: Insert Data via Stored procedure by ado.net Pin
thedom226-Oct-05 13:16
thedom226-Oct-05 13:16 
QuestionCreating a Microsoft Acces &quot;Module&quot; in a MDB-file by Code from C++ Pin
Uwe Keim25-Oct-05 20:08
sitebuilderUwe Keim25-Oct-05 20:08 
AnswerRe: Creating a Microsoft Acces &quot;Module&quot; in a MDB-file by Code from C++ Pin
Uwe Keim25-Oct-05 20:33
sitebuilderUwe Keim25-Oct-05 20:33 
QuestionQuery Tables Fiels name and type Pin
icDavid25-Oct-05 13:12
icDavid25-Oct-05 13:12 
AnswerRe: Query Tables Fiels name and type Pin
icDavid25-Oct-05 14:27
icDavid25-Oct-05 14:27 
AnswerRe: Query Tables Fiels name and type Pin
Farhan Noor Qureshi25-Oct-05 17:59
Farhan Noor Qureshi25-Oct-05 17:59 
QuestionAggregate queries and functions Pin
mjackson1125-Oct-05 10:53
mjackson1125-Oct-05 10:53 
AnswerRe: Aggregate queries and functions Pin
Farhan Noor Qureshi25-Oct-05 12:38
Farhan Noor Qureshi25-Oct-05 12:38 
GeneralRe: Aggregate queries and functions Pin
mjackson1125-Oct-05 18:25
mjackson1125-Oct-05 18:25 
GeneralRe: Aggregate queries and functions Pin
Farhan Noor Qureshi26-Oct-05 11:35
Farhan Noor Qureshi26-Oct-05 11:35 

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.