What is the error?Can you post it?
I dont get any syntax errors with the below sample test query.
create table a(id int primary key)
create table b(id1 int)
ALTER TABLE b
ADD idtest integer
CONSTRAINT FK_test_id FOREIGN KEY (id1)
REFERENCES a (id)
select * from a
select * from b
drop table b
drop table a
PBUH