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
 Converting ORACLE query for MS- SQL Server-2005

Author  Topic 

divyajoshi12
Starting Member

2 Posts

Posted - 2012-04-29 : 00:51:48
Hello friends , I am not able to execute the query for oracle database into MS SQL server-2005. I tried really hard but still error is shown in foreing key section
Here's the query

create table saving_deposit
(ac_no varchar(11)constraint fk_saving_deposit references account_master(ac_no)on delete cascade,
deposit_amt int,
deposit_date Date,
mode_of_deposit varchar(10),
cheque_no varchar(15),
draft_no varchar(15 ),
bank_name varchar(20),
status_update varchar(15),
remarks varchar(10));


And the ERROR SHOWN IS :

Msg 1767, Level 16, State 0, Line 1
Foreign key 'fk_saving_deposit' references invalid table 'account_master'.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.



Please correct this. Thanks in advance.

:)

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2012-04-29 : 01:25:20
[code]check account_master table exist or not ..[/code]
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-04-29 : 08:51:30
is account_master in same database as saving_deposit?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2012-04-29 : 10:52:41
Verify the schema of all tables - is it possible they are not all created in the dbo schema? Coming from Oracle, it may be that these tables are in different schemas.

Either way, I would recommend schema qualifying your tables anyways.
Go to Top of Page
   

- Advertisement -