How to manually create an mssql table

Backstory: For a little over a month now, I’ve been darting between online forums for help on this. I’m new to .net and couldn’t get ssdt or ssms to work on my visual studio in spite of every effort on my part (a story for another day), so I resorted to SQL operations studio, which requires running the queries manually but I discovered the three sql tables created and exported from phpmyadmin, were non-compliant in mssql environment, even though they’re both supposedly children of the same sql standard. There are error markings wherever I have backticks and even when I omit them, the complaint still stands. On further investigation, I now observed it could be because my tables (or the table I’m trying to create) is not “fully qualified” i.e. has no schema. I don’t know how to create a schema or where to find one. In node.js, a schema corresponds to the table structure (which is what I’m trying to create now) so why complain about it before the table is created to begin with?

I’ve tried wrapping the conditions like if and exists in brackets but the script still throws errors on almost every single line. I’ve also looked up differences between mysql and mssql syntax but that hasn’t done me any good either.

Since I cannot find any GUI alternative to sql operations studio i.e. a phpmyadmin variant for mssql, I now want to learn mssql but much to my amazement, I can’t seem to find any books for mssql command reference or study. Google searches keep bringing up results for sql books while I clearly do not want since the language apparently adheres to no standards. I’d really appreciate if anyone can recommend a book that teaches basic things like getting up and running, creating a table via command line or programs like sql operations studio, what a schema means in this context and how to access it, WITHOUT THE OBJECT/SERVER EXPLORER IN VISUAL STUDIO (which as previously mentioned, has defied all my attempts to utilize. See). The three-table queries can be found on this bin. Thank you.

When I see “not qualified” I think
“somefield” vs “sometable”.“somefield” But that doesn’t look to be the problem with your CREATE queries.

Only a complete shot in the dark, but is it better if you remove the ENGINE=MyISAM DEFAULT CHARSET=latin1; from the queries?

The error is thrown much earlier, precisely, at the mention of the very 1st if statement, which I’ve wrapped in parenthesis but then it nullifies the not sub statement. But just to be sure, I omitted it and yet, the errors (plus a few more inclusions) persist.

Have a look at MSSQL Toad for GUI editing of MSSQL it is what i used for a former company use to work for who used MSSQL. I could help point you in the correct direction if we could see your database structure used.

1 Like

After a month of trying, I successfully ran my queries by getting rid of all those nasty if conditions. The tables were then created in the default schema (dbo), so I followed this article and arrived at these queries, which gave me something better.
This does not work for me. But I guess it doesn’t matter anyway, since an error is thrown in sql operations studio if such object already exists.[quote=“jgetner, post:4, topic:282875”]
Have a look at MSSQL Toad for GUI editing of MSSQL
[/quote]

I couldn’t download it because the file size is large and bandwidth costs here are exorbitant. However, any book on this is still welcome. Thanks.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.