Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
valeria76
Starting Member
2 Posts |
Posted - 2008-08-28 : 10:12:22
|
| Good morning!This is my first time in the forum, so I'm not sure I'm doing the things in the correct way. I hope so.My problem is connected with a complex view in the db.The view alone works well. When I add a where condition, it works well. When I add a second condition joined with 'and', it works well. But when I change 'and' with 'or', I receive the following error:Message 248, level 16... The conversion of the '2222222222222'. ls' overflowed an int column. Maximum integer value exceeded.I've looked in the db for this '2222222222222' value, but I' ve found nothing. The problem is connected with a char(2) column not null.I can't understand what the problem could be.Is there anyone who has an idea to solve it?Thank you very much.(Sorry if my English is not always correct) |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-28 : 10:19:49
|
| Can you post the table structure and the definition of the view?MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-28 : 10:21:49
|
| Its may be because of some varchar to int conversion which has such a big quantity as value.Can you show the problem query part? |
 |
|
|
valeria76
Starting Member
2 Posts |
Posted - 2008-08-28 : 11:46:36
|
| This is the query that produced the error:SELECT DISTINCT * FROM PTTR. vBOOKW_SEARCH WHERE BOOKW_BOOKW_KY IS NULL AND ( CUSTOMER_KY = 20 OR CUSTOMER_KY = 4 ) AND ( ( PICKUP_COUNTRY = 13 OR POL_COUNTRY = 13 ) OR (PICKUP_COUNTRY IS NULL AND POL_COUNTRY IS NULL) ) AND OWNER_KY=1 AND STATE= 'V' AND (SERVICE_LANG_ID = 'en' OR SERVICE_LANG_ID IS NULL) AND (TRANSP_MODE_LANG_ID = 'en' OR TRANSP_MODE_LANG_ID IS NULL) AND (TRAFFIC_LANG_ID = 'en' OR TRAFFIC_LANG_ID IS NULL) AND (REFER_LANG_ID = 'en' OR REFER_LANG_ID IS NULL) AND (EV_STATUS_LANG_ID = 'en' OR EV_STATUS_LANG_ID IS NULL) ORDER BY BOOKW_KY DESCIn particular the error is produced by the where condition of column TRANSP_MODE_LANG_ID. This column is the column LANG_ID of the following table:CREATE TABLE [PTTR].[CAT_TRANSPMODE_NLS]([TRANSPORTMODE_KY] [int] NOT NULL,[LANG_ID] [char](2) COLLATE Latin1_General_CS_AS NOT NULL,[TRANSPORTMODE_DESC] [varchar](50) COLLATE Latin1_General_CS_AS NULL,PRIMARY KEY CLUSTERED ([TRANSPORTMODE_KY] ASC,[LANG_ID] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]Thanks for your help! |
 |
|
|
|
|
|