Click here to Skip to main content
15,891,184 members
Home / Discussions / Database
   

Database

 
GeneralRe: Help !!! Pin
Colin Angus Mackay11-Sep-05 1:46
Colin Angus Mackay11-Sep-05 1:46 
QuestionStored Procedure - Verification Pin
phokojoe10-Sep-05 2:35
phokojoe10-Sep-05 2:35 
AnswerRe: Stored Procedure - Verification Pin
Colin Angus Mackay10-Sep-05 5:04
Colin Angus Mackay10-Sep-05 5:04 
GeneralRe: Stored Procedure - Verification Pin
phokojoe10-Sep-05 23:56
phokojoe10-Sep-05 23:56 
GeneralRe: Stored Procedure - Verification Pin
Colin Angus Mackay11-Sep-05 0:15
Colin Angus Mackay11-Sep-05 0:15 
GeneralRe: Stored Procedure - Verification Pin
Colin Angus Mackay11-Sep-05 0:21
Colin Angus Mackay11-Sep-05 0:21 
GeneralRe: Stored Procedure - Verification Pin
phokojoe11-Sep-05 22:11
phokojoe11-Sep-05 22:11 
GeneralRe: Stored Procedure - Verification Pin
Colin Angus Mackay12-Sep-05 1:55
Colin Angus Mackay12-Sep-05 1:55 
I notice that you are putting things like
SELECT 'a1' AS A1...
SELECT 'a2' AS A2...

Remember this is UNIONing all these into one set so it might confuse it* if you give all these different column names, they are supposed to be returning the result into a single column

So, my first suggestion (and its a long shot) is to ensure that the A1, A2, A3 are all the same column name (If I remember I said ColumnName)

DROP PROCEDURE dbo.GetEmptyColumnNames
 
CREATE PROCEDURE dbo.GetEmptyColumnNames
@id numeric
AS
Select 'a1' as ColumnName
FROM hhdata
WHERE (a1 IS NULL Or a1='..') AND refno = @id
UNION
Select 'a2' as ColumnName
FROM hhdata
WHERE (a2 IS NULL Or a2='..') AND refno = @id
UNION
Select 'a3' as ColumnName
FROM hhdata
WHERE (a3 IS NULL Or a3='.') AND refno = @id



phokojoe wrote:
where 043701137010041 is a record in the refno and of course there are many records in the refno column, I thought it will return all the column names in that 043701137010041 which are null or '..'. Infact that is what I want to see.

I'm getting confused by your terminology.

"043701137010041 is a record in the refno" --> a column value in the refno column??
"there are many records in the refno column" --> there are many rows with the same refno??? (A column does not contain records, it contains values)



* DISCLAIMER: I've never thought of putting different column names here, so I don't know what the result would be, but it could explain why you only get the first result back.


My: Blog | Photos

"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious


QuestionFree Databases Pin
Robert M Greene9-Sep-05 16:56
Robert M Greene9-Sep-05 16:56 
QuestionSQL Restore Mystery Pin
mjackson119-Sep-05 13:06
mjackson119-Sep-05 13:06 
AnswerRe: SQL Restore Mystery Pin
Rahul Walavalkar13-Sep-05 0:11
Rahul Walavalkar13-Sep-05 0:11 
QuestionTimeout Expired The timeout period elapsed prior to completion Pin
Jaffer Mumtaz9-Sep-05 1:22
Jaffer Mumtaz9-Sep-05 1:22 
AnswerRe: Timeout Expired The timeout period elapsed prior to completion Pin
OMalleyW9-Sep-05 1:51
OMalleyW9-Sep-05 1:51 
AnswerRe: Timeout Expired The timeout period elapsed prior to completion Pin
miah alom9-Sep-05 5:39
miah alom9-Sep-05 5:39 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
Andy Brummer9-Sep-05 5:57
sitebuilderAndy Brummer9-Sep-05 5:57 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
miah alom9-Sep-05 6:12
miah alom9-Sep-05 6:12 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
Andy Brummer9-Sep-05 11:28
sitebuilderAndy Brummer9-Sep-05 11:28 
AnswerRe: Timeout Expired The timeout period elapsed prior to completion Pin
OMalleyW9-Sep-05 6:48
OMalleyW9-Sep-05 6:48 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
miah alom9-Sep-05 7:04
miah alom9-Sep-05 7:04 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
OMalleyW9-Sep-05 7:34
OMalleyW9-Sep-05 7:34 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
miah alom9-Sep-05 7:56
miah alom9-Sep-05 7:56 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
Jaffer Mumtaz11-Sep-05 19:41
Jaffer Mumtaz11-Sep-05 19:41 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
OMalleyW12-Sep-05 6:32
OMalleyW12-Sep-05 6:32 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
Andy Brummer12-Sep-05 8:27
sitebuilderAndy Brummer12-Sep-05 8:27 
QuestionDataRow Deletion Error.Please Help Me ! Pin
User 20930738-Sep-05 21:10
User 20930738-Sep-05 21:10 

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.