Inserting a value and a constand

Hi,

I am writing a procedure, in it I need to write an INSERT that will add all the values in one column (found in a query) and then the other column needs to have a variable (@NTUserNames) in it.


Cheers
itsallmemanAsked:
Who is Participating?
 
BillAn1Commented:
SELECT @HELLO, Field1  FROM Table1
0
 
itsallmemanAuthor Commented:
To simplify my question
I need a query that returns a constant, something like:
SELECT 'HELLO', Field1  FROM Table1
But how would I go about it if HELLO was in a variable?
0
 
HilaireCommented:
If you need to use the resultset in another place (front-end, another query, ...), you also need an alias (a column name)

select @Hello AS FindMeADecentName, Field1 from ...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.