Click here to Skip to main content
12,950,090 members (60,606 online)
   

Database

 
GeneralRe: SQL Server 2012 annoyance... Pin
Mycroft Holmes27-Feb-13 19:57
memberMycroft Holmes27-Feb-13 19:57 
GeneralRe: SQL Server 2012 annoyance... Pin
_Damian S_27-Feb-13 20:06
member_Damian S_27-Feb-13 20:06 
GeneralRe: SQL Server 2012 annoyance... Pin
Mycroft Holmes27-Feb-13 20:47
memberMycroft Holmes27-Feb-13 20:47 
QuestionWhat order to be followed while generating schema upgrade script? Pin
Member 313707826-Feb-13 18:10
memberMember 313707826-Feb-13 18:10 
AnswerRe: What order to be followed while generating schema upgrade script? Pin
Mycroft Holmes27-Feb-13 20:01
memberMycroft Holmes27-Feb-13 20:01 
GeneralRe: What order to be followed while generating schema upgrade script? Pin
Member 313707827-Feb-13 21:40
memberMember 313707827-Feb-13 21:40 
GeneralRe: What order to be followed while generating schema upgrade script? Pin
Mycroft Holmes27-Feb-13 22:15
memberMycroft Holmes27-Feb-13 22:15 
QuestionSQL weirdness when aliasing columns Pin
Gregory.Gadow22-Feb-13 11:19
memberGregory.Gadow22-Feb-13 11:19 
I have a method that takes a SQL query and a file name, then converts that query into an XML-based Excel file. Works great. The code gets the schema of the query, and uses the column names to generate the column headers in Excel. This, too, works great.

The problem is aliasing the columns into the headers that I want. I am using this notation:
SELECT
    "First Name" = view.MeaninglessColumnNameImposedBySystem1,
    "Last Name" = view.MeaninglessColumnNameImposedBySystem2, 
    "Address 1" = view.MeaninglessColumnNameImposedBySystem3,
...
FROM LongViewName AS view
WHERE etc=@etc

Whether I have one column or 50, the query takes several minutes to run; the more data, the longer it takes. If I were to use SELECT *, with no aliasing, I can return the data in a few seconds, regardless of how many rows are returned.

I have also tried view.MeaninglessColumnNameImposedBySystem1 AS [First Name], which does not speed up the results.

Presumably, this is an optimization issue where * lets SQL make assumptions that it cannot when each column is aliased. Any suggestions on what I can do with the query to speed things up?
AnswerRe: SQL weirdness when aliasing columns Pin
gvprabu22-Feb-13 18:18
membergvprabu22-Feb-13 18:18 
AnswerRe: SQL weirdness when aliasing columns Pin
Mycroft Holmes24-Feb-13 13:08
memberMycroft Holmes24-Feb-13 13:08 
GeneralRe: SQL weirdness when aliasing columns Pin
Gregory.Gadow28-Feb-13 9:09
memberGregory.Gadow28-Feb-13 9:09 
GeneralRe: SQL weirdness when aliasing columns Pin
Mycroft Holmes28-Feb-13 12:04
memberMycroft Holmes28-Feb-13 12:04 
GeneralRe: SQL weirdness when aliasing columns Pin
Gregory.Gadow1-Mar-13 5:10
memberGregory.Gadow1-Mar-13 5:10 
AnswerSolution Pin
Gregory.Gadow1-Mar-13 9:28
memberGregory.Gadow1-Mar-13 9:28 
GeneralRe: Solution Pin
Mycroft Holmes1-Mar-13 11:53
memberMycroft Holmes1-Mar-13 11:53 
QuestionDatabase Pin
Member 961179522-Feb-13 8:52
memberMember 961179522-Feb-13 8:52 
AnswerRe: Database Pin
jschell22-Feb-13 9:30
memberjschell22-Feb-13 9:30 
AnswerRe: Database Pin
mark merrens22-Feb-13 10:38
membermark merrens22-Feb-13 10:38 
GeneralRe: Database Pin
Member 961179523-Feb-13 1:05
memberMember 961179523-Feb-13 1:05 
GeneralRe: Database Pin
S Douglas28-Feb-13 7:58
memberS Douglas28-Feb-13 7:58 
AnswerRe: Database Pin
Jörgen Andersson22-Feb-13 11:11
memberJörgen Andersson22-Feb-13 11:11 
AnswerRe: Database Pin
PIEBALDconsult22-Feb-13 13:38
memberPIEBALDconsult22-Feb-13 13:38 
QuestionSQL Server + Procedure or function has too many arguments specified Pin
Hemant Thaker21-Feb-13 18:53
memberHemant Thaker21-Feb-13 18:53 
AnswerRe: SQL Server + Procedure or function has too many arguments specified Pin
Sandeep Mewara21-Feb-13 19:00
mvpSandeep Mewara21-Feb-13 19:00 
AnswerRe: SQL Server + Procedure or function has too many arguments specified Pin
Mycroft Holmes21-Feb-13 20:29
memberMycroft Holmes21-Feb-13 20:29 

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.


Advertise | Privacy | Mobile
Web01 | 2.8.170525.1 | Last Updated 25 May 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid