Welcome Guest Search | Active Topics | Log In | Register

Invalid data type specification?? Options
davidmccallum
#1 Posted : Thursday, July 02, 2009 1:56:59 AM
Rank: Team VistaDB

Groups: Member, Team VistaDB

Joined: 8/13/2006
Posts: 515
Points: 2,289
Location: Edinburgh, Scotland
Executing the following SQL (Build: 3.6.86)
Code:
CREATE TABLE [MailTemplates] DESCRIPTION 'Contains Email templates'
(
[TemplateId] BIGINT NOT NULL,
);


ALTER TABLE [MailTemplates]
ADD
CONSTRAINT [Primary Key] PRIMARY KEY ([TemplateId]);

ALTER TABLE [MailTemplates] ADD COLUMN [TypeId] INT;

Throws the following exception
Quote:

Error 624 (Provider v. 3.6.86.1): Invalid data type specification
Line #: 4; Column #: 2
Error 509 (Provider v. 3.6.86.1): Invalid statement: TABLE
Line #: 1; Column #: 8

Any ideas?
js_vistadb
#2 Posted : Thursday, July 02, 2009 11:07:14 AM
Rank: VistaDB Staff

Groups: Administration, VistaDB Staff

Joined: 8/13/2006
Posts: 3,362
Points: 3,891
Location: Mount Dora, Florida
Sorry, looks like it is broken. Not sure how at this point. We will take a look.

Jason Short

js_vistadb
#3 Posted : Thursday, July 02, 2009 3:38:22 PM
Rank: VistaDB Staff

Groups: Administration, VistaDB Staff

Joined: 8/13/2006
Posts: 3,362
Points: 3,891
Location: Mount Dora, Florida
The error message may be cryptic, but the error is in your SQL:

Code:
CREATE TABLE [MailTemplates] DESCRIPTION 'Contains Email templates'
(
[TemplateId] BIGINT NOT NULL,  <---------------
);



You have a comma after the NOT NULL so it is trying to find a second column and can't so you get the error.

Jason Short

davidmccallum
#4 Posted : Friday, July 03, 2009 1:00:52 AM
Rank: Team VistaDB

Groups: Member, Team VistaDB

Joined: 8/13/2006
Posts: 515
Points: 2,289
Location: Edinburgh, Scotland
Oops missed that, I cut from a much larger CREATE statement, but still:
Code:
CREATE TABLE [MailTemplates] DESCRIPTION 'Contains Email templates'
(
[TemplateId] BIGINT NOT NULL
);


ALTER TABLE [MailTemplates]
ADD
CONSTRAINT [Primary Key] PRIMARY KEY ([TemplateId]);

ALTER TABLE [MailTemplates] ADD COLUMN [TypeId] INT;
results in
Quote:
Error 624 (Provider v. 3.6.86.1): Invalid data type specification
Line #: 11; Column #: 40
Error 509 (Provider v. 3.6.86.1): Invalid statement: TABLE
Line #: 11; Column #: 7
Krenshau
#5 Posted : Friday, July 03, 2009 3:06:21 AM
Rank: Team VistaDB

Groups: Member, Team VistaDB

Joined: 8/15/2006
Posts: 412
Points: 2,284
This seems to work.

Code:

CREATE TABLE [MailTemplates]
(
[TemplateId] BIGINT NOT NULL
);


ALTER TABLE [MailTemplates]
ADD
CONSTRAINT [Primary Key] PRIMARY KEY ([TemplateId]);

ALTER TABLE [MailTemplates] ADD [TypeId] INT;


I removed the word COLUMN from the last line. I don't know if that is the way it is supposed to be, or not, though.

EDIT: Looks like this is the correct syntax for SQL Server if I understand this page correctly.

http://msdn.microsoft.com/en-us/library/aa275462(SQL.80).aspx


Ben
QAS Information Systems
davidmccallum
#6 Posted : Friday, July 03, 2009 5:35:07 AM
Rank: Team VistaDB

Groups: Member, Team VistaDB

Joined: 8/13/2006
Posts: 515
Points: 2,289
Location: Edinburgh, Scotland
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.077 seconds.