0

I found this SQL generated by visual studio on an asp.net project. I'm trying to run the SQL script directly, however the brackets are causing syntax errors in SQL Server. Any idea why Visual Studio generates the brackets?

I am not a Microsoft developer so this is total new to me. All I know is that this uses ADO.NET,... I think.

CREATE TABLE [dbo].[_Something] (
    [Client] NVARCHAR(50) NULL,
    .
    .
)

I will not accept any answer referring to using Visual Studio GUI. I want to know the reason why Visual Studio generates this type of SQL, not how to fix the syntax error.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Dr.Knowitall
  • 10,080
  • 23
  • 82
  • 133
  • What brackets? I didn't see anything wrong in that code. – SᴇM Sep 20 '17 at 04:56
  • This looks like valid MS-SQL syntax. Some details would help. Like which of the brackets is giving you trouble? Also, what's the error you're getting? – Ash Sep 20 '17 at 04:56
  • There is nothing wrong with that sql syntax, so I'm not sure what syntax errors you would be encountering. It's also not clear which brackets you're referring to. The square brackets? That's a standard way delimiting identifiers in SQL. The regular brackets? Those are necessary for specifying parameters (the columns in the table and the character length). – ZLK Sep 20 '17 at 04:56
  • hmmm... how can square brackets cause syntax error in SQL server? – SᴇM Sep 20 '17 at 04:58

0 Answers0