Solved

sql - query returning no column name when name is specified

Posted on 2013-12-04
3
387 Views
Last Modified: 2013-12-10
Hi

The following query is returning no column name when then name 'iOutDistributionid' is specified
niether
select *,@iDistributionid as 'iOutDistributionid' from #tmpDistribution
nor
select *,@iDistributionid as [iOutDistributionid] from #tmpDistribution
work
the data ie @iDistributionid is in each row ok

eg
customerid [no colomn name]
1                   1
2                   1
0
Comment
Question by:louise_8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
duttcom earned 100 total points
ID: 39697470
Have you tried without the quotes or square brackets? I never use any text qualifiers when creating aliases for columns.
0
 

Author Comment

by:louise_8
ID: 39697548
yes I tried that first, no luck
0
 

Author Closing Comment

by:louise_8
ID: 39710267
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question