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

Database

 
AnswerRe: Add a new IDENTITY Pin
Elina Blank7-Jul-06 8:11
sitebuilderElina Blank7-Jul-06 8:11 
GeneralRe: Add a new IDENTITY Pin
TheEagle7-Jul-06 9:29
TheEagle7-Jul-06 9:29 
GeneralRe: Add a new IDENTITY Pin
Elina Blank7-Jul-06 10:34
sitebuilderElina Blank7-Jul-06 10:34 
GeneralRe: Add a new IDENTITY Pin
TheEagle7-Jul-06 22:37
TheEagle7-Jul-06 22:37 
GeneralRe: Add a new IDENTITY Pin
Elina Blank10-Jul-06 4:04
sitebuilderElina Blank10-Jul-06 4:04 
GeneralRe: Add a new IDENTITY Pin
TheEagle11-Jul-06 1:36
TheEagle11-Jul-06 1:36 
GeneralRe: Add a new IDENTITY Pin
Elina Blank11-Jul-06 2:32
sitebuilderElina Blank11-Jul-06 2:32 
QuestionORDER BY question Pin
leckey7-Jul-06 6:51
leckey7-Jul-06 6:51 
I have a stored proc which populates a drop-down box in an ASP.NET datagrid. The user enters a part number and the datagrid populates based on that part number. The datagrid is already in edit mode using template columns.

What I would like to do on the SQL side if possible is the following:
a) If the part number does not exist, populate the drop-down box with all part types, and order by description. (Okay, this is no problem.)
b) If the part number DOES exist, populate the drop-down box with all part types, but list the saved description first, then list the rest by description.

This is what I have thus far:
CREATE PROCEDURE [dbo].[GetPartDescriptions]<br />
<br />
@PartNumber varchar (60)<br />
<br />
 AS<br />
if NOT EXISTS (Select * from Parts where PartNumber = @PartNumber)<br />
BEGIN<br />
SELECT ID as ptID, Description from PartTypes pt ORDER by Description<br />
END<br />
<br />
GO

AnswerRe: ORDER BY question Pin
Jerry Hammond8-Jul-06 4:54
Jerry Hammond8-Jul-06 4:54 
GeneralRe: ORDER BY question Pin
Paul Conrad8-Jul-06 19:54
professionalPaul Conrad8-Jul-06 19:54 
GeneralRe: ORDER BY question Pin
Jerry Hammond9-Jul-06 3:22
Jerry Hammond9-Jul-06 3:22 
GeneralRe: ORDER BY question Pin
leckey10-Jul-06 3:17
leckey10-Jul-06 3:17 
GeneralRe: ORDER BY question Pin
Paul Conrad10-Jul-06 6:33
professionalPaul Conrad10-Jul-06 6:33 
Questiondynamic query in SQL Server 2000 Pin
SomeGuyThatIsMe7-Jul-06 4:50
SomeGuyThatIsMe7-Jul-06 4:50 
AnswerRe: dynamic query in SQL Server 2000 Pin
Eric Dahlvang7-Jul-06 5:57
Eric Dahlvang7-Jul-06 5:57 
GeneralRe: dynamic query in SQL Server 2000 Pin
SomeGuyThatIsMe7-Jul-06 6:04
SomeGuyThatIsMe7-Jul-06 6:04 
Questionsound & video Pin
md_refay7-Jul-06 4:09
md_refay7-Jul-06 4:09 
AnswerRe: sound & video Pin
Not Active7-Jul-06 4:17
mentorNot Active7-Jul-06 4:17 
AnswerRe: sound & video Pin
Scott Serl7-Jul-06 6:05
Scott Serl7-Jul-06 6:05 
QuestionBEGIN and END Pin
Brendan Vogt7-Jul-06 0:25
Brendan Vogt7-Jul-06 0:25 
AnswerRe: BEGIN and END Pin
Mike Dimmick7-Jul-06 2:54
Mike Dimmick7-Jul-06 2:54 
GeneralRe: BEGIN and END Pin
Frank Kerrigan7-Jul-06 3:16
Frank Kerrigan7-Jul-06 3:16 
QuestionSQL query problem, thanks Pin
zouchao11126-Jul-06 20:42
zouchao11126-Jul-06 20:42 
AnswerRe: SQL query problem, thanks Pin
Glen Harvy6-Jul-06 22:27
Glen Harvy6-Jul-06 22:27 
GeneralRe: SQL query problem, thanks Pin
zouchao11127-Jul-06 3:32
zouchao11127-Jul-06 3:32 

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.