Sha256: 389387d65b43928750037d12ecf8c3afe3f62ae0df4b473aa834f390cff4aafe

Contents?: true

Size: 915 Bytes

Versions: 8

Compression:

Stored size: 915 Bytes

Contents

:ON ERROR EXIT

PRINT 'RUNNING DB-LOGIN.SQL';

PRINT 'CREATING TINYTDS TEST LOGIN';
IF NOT EXISTS (select name from sys.server_principals where name like 'tinytds')
BEGIN
  CREATE LOGIN [tinytds] WITH PASSWORD = '', CHECK_POLICY = OFF, DEFAULT_DATABASE = [tinytdstest];
END
GO

IF EXISTS (select name from sys.server_principals where name like 'tinytds')
BEGIN
  PRINT 'TINY TDS TEST LOGIN SUCCESSFULY CREATED';
END
ELSE
BEGIN
  THROW 51000, 'TINY TDS TEST LOGIN CREATION FAILED', 1;
END
GO

USE [tinytdstest];
IF NOT EXISTS (select name from sys.database_principals where name LIKE 'tinytds')
BEGIN
  CREATE USER [tinytds] FOR LOGIN [tinytds];
  EXEC sp_addrolemember N'db_owner', N'tinytds';
END
GO

IF EXISTS (select name from sys.database_principals where name LIKE 'tinytds')
BEGIN
  PRINT 'TINY TDS TEST USER SUCCESSFULY CREATED';
END
ELSE
BEGIN
  THROW 51000, 'TINY TDS TEST USER CREATION FAILED', 1;
END
GO

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tiny_tds-2.1.7-x64-mingw-ucrt test/sql/db-login.sql
tiny_tds-2.1.7-x64-mingw32 test/sql/db-login.sql
tiny_tds-2.1.7-x86-mingw32 test/sql/db-login.sql
tiny_tds-2.1.7 test/sql/db-login.sql
tiny_tds-2.1.6-x86-mingw32 test/sql/db-login.sql
tiny_tds-2.1.6-x64-mingw-ucrt test/sql/db-login.sql
tiny_tds-2.1.6-x64-mingw32 test/sql/db-login.sql
tiny_tds-2.1.6 test/sql/db-login.sql