|
|
|
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?
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
Rank: Team VistaDB
Groups: Member, Team VistaDB
Joined: 8/13/2006 Posts: 515 Points: 2,289 Location: Edinburgh, Scotland
|
Oops
|
|
|
|
Guest
|
YAFPro Theme Created by Jaben Cargman (Tiny Gecko)Powered by YAF 1.9.3 |
YAF © 2003-2009, Yet Another Forum.NETThis page was generated in 0.077 seconds.