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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Incorrect Syntax near '*'

Author  Topic 

handinugraha
Starting Member

8 Posts

Posted - 2010-01-07 : 21:57:05
Hi guys

Im currently doing my internship in company that relates on websites. They gave me a task to migrate oracle to sql. Since im really new to database especially this complex task i really need help from u.
Ok firstly i got this error

Incorrect syntax near '*' which comes from this line

"BRANCH_ID" NUMERIC (*,0)

as far i know that oracle use number for data type , and i changed it to numeric but after that i dont know especially the figure on the bracket..

I really need ur help for this , sorry coz im really new..

Thanks

Newbie to SQL Server

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-01-07 : 22:03:54
you need to define the precision

like

BRANCH_ID NUMERIC(10,0)

you may refer to the Books OnLine on NUMERIC
http://msdn.microsoft.com/en-us/library/ms187746.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

handinugraha
Starting Member

8 Posts

Posted - 2010-01-07 : 22:10:57
yah it is working..thanks khtan

Newbie to SQL Server
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-08 : 02:05:42
Numeric(10,0) then you can use integer also
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-01-08 : 03:01:36
quote:
Originally posted by visakh16

Numeric(10,0) then you can use integer also
Not for numbers between 2,147,483,648 and 9,999,999,999.


N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-08 : 03:08:00
quote:
Originally posted by Peso

quote:
Originally posted by visakh16

Numeric(10,0) then you can use integer also
Not for numbers between 2,147,483,648 and 9,999,999,999.


N 56°04'39.26"
E 12°55'05.63"



in that case you can go for bigint
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-01-08 : 04:35:56
Yes. A bigint is only 8 bytes and numeric(10, 0) is 9 bytes storage.
Use bigint and put a check constraint on the column allowing only numbers between 1 and 9,999,999,999 (for positive numbers).



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

handinugraha
Starting Member

8 Posts

Posted - 2010-01-08 : 05:08:10
thanks guys it is already working..
:)

Newbie to SQL Server
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-08 : 10:40:27
great
Go to Top of Page
   

- Advertisement -