Revolving around the core of technology
Hi,
I evaluate WinSQL 10 to check whether it fixes an issue with the "Generate CREATE TABLE statement" functionality of our WinSQL 7 version ("nvarchar" columns are not supported).
But this feature does not work at all in the standalone "WinSQLRaw" version. No matter whether I use 32 or 64 bit version, I only see this error message:
Kein schließendes Anführungszeichen nach der Zeichenfolge ''.
Falsche Syntax in der Nähe von ''.
Falsche Syntax in der Nähe von ' + CHAR(13) + CHAR(10), -2
UNION
select '.
Falsche Syntax in der Nähe von ', -1
UNION
select CAST( CASE s.colorder WHEN 1 THEN '.
'CREATE DEFAULT' muss die erste Anweisung in einem Abfragebatch sein.
Die @objectId-Skalarvariable muss deklariert werden.
Kein schließendes Anführungszeichen nach der Zeichenfolge ''.
Falsche Syntax in der Nähe von ''.
Kein schließendes Anführungszeichen nach der Zeichenfolge ' + CHAR(13) + CHAR(10)
'.
ALTER TABLE [dbo].[APP_Config] WITH NOCHECK
ADD CONSTRAINT [APP_Config_PK]
PRIMARY KEY (KeyName, GueltigAb)
ON [PRIMARY]
Kein schließendes Anführungszeichen nach der Zeichenfolge ''.
Falsche Syntax in der Nähe von ''.
Falsche Syntax in der Nähe von ' + CHAR(13) + CHAR(10)
DECLARE @pkConstraint varchar(2000)
DECLARE @userName varchar(128), @tableName varchar(128),
@f'.
Kein schließendes Anführungszeichen nach der Zeichenfolge ' + CHAR(13) + CHAR(10)
END
CLOSE constCursor
DEALLOCATE constCursor
'.
Kein schließendes Anführungszeichen nach der Zeichenfolge ''.
Falsche Syntax in der Nähe von ''.
Falsche Syntax in der Nähe von '
from syscomments cv, sysdepends de, sysobjects tb, sysobjects dt
where tb.name = @tableName
and cv.id = de.id
and tb'.
Kein schließendes Anführungszeichen nach der Zeichenfolge ''.
Is this a problem when using the standalone (not installed version)? On my machine, an instance of WinSQL 7 is installed.
Best regards
Wolfgang
Wolfgang,
What version of SQL Server are you using?
There are two ways to generate the "CREATE TABLE" statement in WinSQL: with or without the plugin. The error you are running into is related to Plugin. See if the version without plugin works for you. Here are the steps:
Let me know what happens.
Imran
I deinstalled WinSQL 7 on my machine. Still no improvement. But then I removed the directory "C:\Users\USERNAME\AppData\Roaming\WinSQL", and afterwards it worked.
I also noticed that our issue with WinSQL 7 ("nvarchar" datatype did not work) is fixed.
Just for the records: "Shift + click" also worked in the initial situation. This is the output:
-- Object: Table: dbo.APP_Config - Script date: 01.12.2016 08:56:25
CREATE TABLE dbo.APP_Config (
KeyName varchar(254) NOT NULL,
GueltigAb datetime NOT NULL,
ValueText varchar(4000),
Type varchar(100),
Bemerkung nvarchar(1000)
)
;
-- Primary key
ALTER TABLE dbo.APP_Config ADD PRIMARY KEY (KeyName, GueltigAb)
;
Best regards
Wolfgang
Just one more detail to "finalize" this thread: the "create table" in WinSQL 7 seems to fail only for SQLServer 2014, but not for previous versions. So my assumption that it would be related to the "nvarchar" columns was wrong.
Best regards
Wolfgang
Hi,
I think I found the setting which causes this trouble: it seems to depend on the settings. I can reproduce the error on a MSSQL 2008 or MSSQL 2014 database with those modified settings:
"Query terminator string": semicolon (";") instead of "go"
"Terminators must be on a new line": unchecked (default is checked)
"Terminator must be the last character on line": unchecked (default is checked).
The latter setting seems to cause the error on "Create table" command.
Best regards
Wolfgang