473,322 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Problem in some SQL server

1
Hi
The following query works in all SQL server2000 except one server.
DECLARE @TBLAvgTOD_Page_Temp TABLE
(
Time_day_Month INT,
UnitID VARCHAR(10),
AverageFrom Decimal(20,2),
AverageTo Decimal(20,2)

)
DECLARE @TBLAvgTOD_Page TABLE
(

RowNum int IDENTITY (1, 1) NOT NULL,
Time_day_Month INT,
UnitID VARCHAR(10),
AverageFrom Decimal(20,2),
AverageTo Decimal(20,2)

)

DECLARE @SortColumn VARCHAR(30),
@SortOrder VARCHAR(5)

INSERT INTO @TBLAvgTOD_Page
(
Time_day_Month,
UnitID,
AverageFrom,
AverageTo
)

SELECT * FROM @TBLAvgTOD_Page_Temp
ORDER BY

case when @SortColumn='Time_Day_Month_Formated' and @SortOrder='Desc' then Time_Day_Month end desc,
case when @SortColumn='Time_Day_Month_Formated' and @SortOrder='asc' then Time_Day_Month end asc,

case when @SortColumn='UnitID' and @SortOrder='Desc' then UnitID end desc,
case when @SortColumn='UnitID' and @SortOrder='asc' then UnitID end asc,

case when @SortColumn='AverageFrom' and @SortOrder='Desc' then AverageFrom end desc,
case when @SortColumn='AverageFrom' and @SortOrder='asc' then AverageFrom end asc,

case when @SortColumn='AverageTo' and @SortOrder='Desc' then AverageTo end desc,
case when @SortColumn='AverageTo' and @SortOrder='asc' then AverageTo end asc


In that machine I get an error
"Column name doesnot match the table defenition." Any idea?
Nov 12 '07 #1
1 902
debasisdas
8,127 Expert 4TB
As you have posted a question in the SQL Server Articles section it is being moved to SQL Server Forum.
Nov 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application...
5
by: Nedu N | last post by:
Hi All, I am facing a typical problem in my .NET application with the pop-up script messages. The thing is that its working fine when i run on my development machine but not running in expected...
11
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as...
11
by: ASP newbie | last post by:
I cannot run my asp.net application in w2k server. But the program works fine under w2k professional. Can anyone tell me is there any difference in the settings? Many thanks.
0
by: richard | last post by:
OS: Winxp and Win2003 Visual Basic.NET 2003 MS-SQL Server 2000 hey all I am a newbie in vb.net but i have managed to build a simple chat server in vb.net using socket and a client connecting...
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
1
by: Steven M. | last post by:
Greetings... I need desperate help with my problem. I guess the solution is related in some way with the cookies getting lost in the authentication process working with some web servers. ...
12
by: Light | last post by:
Hi all, I posted this question in the sqlserver.newusers group but I am not getting any response there so I am going to try it on the fine folks here:). I inherited some legacy ASP codes in my...
1
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.