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.
Author |
Topic |
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2010-12-08 : 22:12:08
|
Dear All,Warmest Regards.Below is mysqlcode, could anyone tell me how to write in mssql code??1) ALTER TABLE LibraryServiceSET FOREIGN_KEY_CHECKS=12) CREATE TABLE `LibraryBook` ( `libraryID` int(10) unsigned NOT NULL, `bookISBN` varchar(22) NOT NULL, `location` varchar(80) NOT NULL, PRIMARY KEY (`libraryID`,`bookISBN`), KEY `bookISBN` (`bookISBN`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;Thank you.Regards,Micheale |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-12-09 : 00:37:15
|
Homework?Open up SQL Server Books Online (the included help file) and look up ALTER TABLE and CREATE TABLE.SQL doesn't have the option to disable foreign key checks per table. You can drop or disable a constraint, but not disable just the checks.--Gail ShawSQL Server MVP |
 |
|
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2010-12-09 : 00:50:18
|
Thank you for the reply. For create table, I stuck only at 1 command Create .... Key bookISBN(bookISBN). The rest all i able to do. At MS SQL it's show me error if i do Key bookISBN(bookISBN).Any idea on this?Thank you.Regards,Micheale |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-12-09 : 11:42:21
|
Yes, because that's the wrong syntax. Did you look up the create table syntax as I suggested? Specifically at how you specify foreign keys?--Gail ShawSQL Server MVP |
 |
|
|
|
|