Solved

sql - query returning no column name when name is specified

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
2016 SQL Licensing 7 41
MS SQL + Insert Into Table - If Doesnt Exist 9 35
Return 0 on SQL count 24 30
SQL Syntax: How to force case sensitive query? 2 29
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

773 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