Solved

sql - query returning no column name when name is specified

Posted on 2013-12-04
3
383 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

828 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