Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SP errmsg 'Invalid column 'real' is specified in a constraint or computed-column definition.'

Posted on 2006-05-02
13
Medium Priority
?
569 Views
Last Modified: 2008-09-19
I'm creating a temp table in a SQL2K SP and am getting the error mentioned in the title.

-- ALL MILLIMAN NAMED RANGES that will be passed to the Milliman Model v2.3.0
IF OBJECT_ID('tempdb..#tmp') IS NOT NULL
      drop table #tmp

CREATE TABLE #tmp (
      CASE_ID varchar(25),
      PREX_ID int,
      PREX2_ID int,
      PLCY_ID int,
      FNDC_ID int,
      OFFR_ID int,
      NumLives char(1),
      Issue_basis char(1),
      Issue_date datetime,
      product_type char(1),
      UL_Illus_AV_1 as real,
      UL_Illus_AV_2 as real,
      UL_Illus_AV_3 as real)


If anyone has any ideas on how to get around this, I'd be appreciative.

Thanks in advance.
-Jim
0
Comment
Question by:Jim Horn
  • 4
  • 3
  • 3
  • +2
12 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16590977
do you really need to use the REAL (or float) data type, anything against using DECIMAL(20,4)
0
 
LVL 66

Author Comment

by:Jim Horn
ID: 16590990
Need?  Probably not, I'm dealing with whole numbers <= 10,000,000.

Also, I tried using float and decimal(20,4) in place of real in my sp, and received similar error messages.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16591004
real and float are unprecise data types, hence indexes are not allowed on them.

if you deal with while numbers, you should use int or bigint
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 66

Author Comment

by:Jim Horn
ID: 16591020
Actually, I just figured it out.  I need to get rid of the 'as' in the create table statement.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16591035
good spot :-)
I see, you leave the status of N00b in M$SQL Server !!
0
 
LVL 66

Author Comment

by:Jim Horn
ID: 16591061
Wow.  At least I accomplished something today.. :)
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16592263
jimhorn,
>      UL_Illus_AV_1 as real,
>      UL_Illus_AV_2 as real,
>      UL_Illus_AV_3 as real)

 replace the above with the following

    UL_Illus_AV_1  real,
     UL_Illus_AV_2  real,
     UL_Illus_AV_3  real
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16592266
jimhorn,
> I need to get rid of the 'as' in the create table statement.

Sorry I didn't see your post..
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16593631
no objections
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16593665
No objections form my side too
0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16594185
PAQ-ing the question and refunding 500 points

Thanks !

GranMod
The Experts Exchange
Community Support Moderator of all Ages
0
 
LVL 2

Expert Comment

by:stopher2475
ID: 22523933
"Actually, I just figured it out.  I need to get rid of the 'as' in the create table statement."
You just solved my problem. Thanks!
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

578 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