I've installed SQL Server 2012 Express. I'm doing some test with this and Server 2008 Express.
With 2008, all is ok. But with the 2012, I get some troubles.
I'm using it from my c# app, with code like this:
t = server.ConnectionContext.ExecuteNonQuery("SELECT * FROM sys.server_principals");
The query in the row above is only a test I've done, after the script I need get error.
But, also this get the same error: MODIFY FILE failed. Specified size is less than or equal to current size. But why? I saw around that this error comes when something is done about the log... or not?
Why I get this error? The login data are correctly. This a new installation, so I am logged in as sa
(the script will then create a new user).
The same script works perfectly with SQL Server 2008 Express. I don't get why with 2012 is in this way.. what am I missing? Further, I install both 2008 and 2012 from command line with the same parameter:
/q /hideconsole /action=Install /features=SQL /instancename=SQLEXPRESS
/securitymode=SQL /sapwd=xxx /enableranu=1 /sqlsvcaccount="NT Authority\Network Service"
/AddCurrentUserAsSqlAdmin /IAcceptSqlServerLicenseTerms
/skiprules=RebootRequiredCheck
Anyway, the script I want to run is (but, as I said, also the simply SQL above causes the error):
IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = ****')
CREATE LOGIN [icaddb]
WITH PASSWORD = '****', DEFAULT_DATABASE = [master],
DEFAULT_LANGUAGE = [us_english], CHECK_EXPIRATION = OFF, CHECK_POLICY = ON
GO
EXEC sys.sp_addsrvrolemember @loginame = ****', @rolename = N'sysadmin'
GO
EDIT: