IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Soggetti2Utente_DOMINIO]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Soggetti2Utente] DROP CONSTRAINT [DF_Soggetti2Utente_DOMINIO]
END

GO

USE [GMW_prod]
GO

/****** Object:  Table [dbo].[Soggetti2Utente]    Script Date: 07/16/2010 17:30:24 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Soggetti2Utente]') AND type in (N'U'))
DROP TABLE [dbo].[Soggetti2Utente]
GO

-- creazione tabella Soggetti2Utenti

create table Soggetti2Utente(
  CodSoggetto nchar(16)    not null,
  USER_NAME   nvarchar(50) not null,
  DOMINIO     varchar(30)  collate SQL_Latin1_General_CP1_CI_AS constraint DF_Soggetti2Utente_DOMINIO default ('DOMITBREMBO'),

  constraint PK_Soggetti2Utente primary key(CodSoggetto,USER_NAME)
)
go


-- update dati tabella Soggetti2Utente

set xact_abort on
go

begin transaction
go

INSERT INTO dbo.Soggetti2Utente
  VALUES (N'O900000000000001', N'samuele', 'STEAMWAREWIN')
INSERT INTO dbo.Soggetti2Utente
  VALUES (N'O900000000000002', N'marco', 'STEAMWAREWIN')
INSERT INTO dbo.Soggetti2Utente
  VALUES (N'O900000000000003', N'ermanno', 'STEAMWAREWIN')
go

commit transaction
go



-- registro versione...
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(90, GETDATE())
GO
