Click here to Skip to main content
15,791,520 members
Home / Discussions / Database
   

Database

 
GeneralRe: postgresql VACUUM Pin
V.7-May-15 4:41
professionalV.7-May-15 4:41 
QuestionSequence number in DB2 Pin
sudevsu5-May-15 10:57
sudevsu5-May-15 10:57 
QuestionTest sol Pin
Stephen Holdorf30-Apr-15 12:24
Stephen Holdorf30-Apr-15 12:24 
GeneralRe: Help with a SQL query Pin
PIEBALDconsult30-Apr-15 20:33
professionalPIEBALDconsult30-Apr-15 20:33 
GeneralRe: Help with a SQL query Pin
Stephen Holdorf1-May-15 3:54
Stephen Holdorf1-May-15 3:54 
GeneralRe: Help with a SQL query Pin
Stephen Holdorf20-May-15 4:27
Stephen Holdorf20-May-15 4:27 
GeneralRe: Help with a SQL query Pin
Stephen Holdorf20-May-15 4:39
Stephen Holdorf20-May-15 4:39 
AnswerRe: Help with a SQL query with all inappropriate information removed Pin
Richard Deeming1-May-15 4:39
mveRichard Deeming1-May-15 4:39 
QuestionRe: Test sol Pin
Eddy Vluggen4-May-15 9:20
professionalEddy Vluggen4-May-15 9:20 
QuestionDynamically Add Column Name Pin
MadDashCoder29-Apr-15 4:44
MadDashCoder29-Apr-15 4:44 
Hi all, I have a function that receives a column name and it will return this column name when the function is called, if the column name is not null.

This function will be called in a stored proc inside of the Select statement. The function will return the name of a column entered as input and it will be used inside of the Select statement.

The following is my function
Create function GetName(@C nvarchar(50))
Returns nvarchar(50)
As
Begin 
   Declare @Col_Name nvarchar(50)<br />
     IF (@Col IS NOT null) 
    Begin 
    Set @ColumName = @Col<br />
     END 
        Return @Col_Name
End

I expect this function to return any input a user enters but it doesn't return anything and I'm not getting any errors. Also how do I call this function in my stored proc so that the column name is added to the select statement automatically. Any help is great, thanks.

modified 29-Apr-15 10:34am.

AnswerRe: Dynamically Add Column Name Pin
Sascha Lefèvre29-Apr-15 6:11
professionalSascha Lefèvre29-Apr-15 6:11 
GeneralRe: Dynamically Add Column Name Pin
MadDashCoder29-Apr-15 14:43
MadDashCoder29-Apr-15 14:43 
GeneralRe: Dynamically Add Column Name Pin
Corporal Agarn30-Apr-15 2:48
professionalCorporal Agarn30-Apr-15 2:48 
GeneralRe: Dynamically Add Column Name Pin
Richard Deeming30-Apr-15 2:52
mveRichard Deeming30-Apr-15 2:52 
GeneralRe: Dynamically Add Column Name Pin
Corporal Agarn30-Apr-15 7:38
professionalCorporal Agarn30-Apr-15 7:38 
AnswerRe: Dynamically Add Column Name Pin
Corporal Agarn29-Apr-15 6:37
professionalCorporal Agarn29-Apr-15 6:37 
GeneralRe: Dynamically Add Column Name Pin
MadDashCoder30-Apr-15 7:11
MadDashCoder30-Apr-15 7:11 
QuestionStarting a SSIS 2012 DTSX package without validating it? Pin
Dr Miroslav Stimac29-Apr-15 2:39
professionalDr Miroslav Stimac29-Apr-15 2:39 
AnswerRe: Starting a SSIS 2012 DTSX package without validating it? Pin
Snorri Kristjansson22-May-15 2:39
professionalSnorri Kristjansson22-May-15 2:39 
Questiondatabase Pin
surender singh28-Apr-15 23:01
surender singh28-Apr-15 23:01 
AnswerRe: database Pin
Richard MacCutchan29-Apr-15 0:05
mveRichard MacCutchan29-Apr-15 0:05 
AnswerRe: database Pin
Richard Deeming29-Apr-15 2:55
mveRichard Deeming29-Apr-15 2:55 
QuestionMySQL Server does not show up in Installer Pin
QuickBooksDev28-Apr-15 1:26
QuickBooksDev28-Apr-15 1:26 
AnswerRe: MySQL Server does not show up in Installer Pin
Herman<T>.Instance29-Apr-15 10:57
Herman<T>.Instance29-Apr-15 10:57 
QuestionDoubt in oralce table Pin
Balaji Naidu27-Apr-15 10:39
Balaji Naidu27-Apr-15 10:39 

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.