Eccole:
USE [crm_searchgroup]
GO
/****** Object: Table [dbo].[Logins] Script Date: 10/07/2010 12:08:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Logins](
[UID] [int] NOT NULL,
[username] [varchar](200) NOT NULL,
[password] [varchar](500) NOT NULL,
[parent] [int] NOT NULL,
CONSTRAINT [PK_Logins] PRIMARY KEY CLUSTERED
(
[UID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[Logins] WITH CHECK ADD CONSTRAINT [FK_Logins_User_Profiles] FOREIGN KEY([UID])
REFERENCES [dbo].[User_Profiles] ([UID])
GO
ALTER TABLE [dbo].[Logins] CHECK CONSTRAINT [FK_Logins_User_Profiles]
GO
ALTER TABLE [dbo].[Logins] ADD CONSTRAINT [DF_Logins_parent] DEFAULT ((-1)) FOR [parent]
GO
USE [crm_searchgroup]
GO
/****** Object: Table [dbo].[User_Profiles] Script Date: 10/07/2010 12:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[User_Profiles](
[UPID] [int] IDENTITY(1,1) NOT NULL,
[UID] [int] NOT NULL,
[ragione_sociale] [varchar](250) NOT NULL,
[indirizzo] [varchar](150) NULL,
[cap] [char](6) NULL,
[citta] [varchar](30) NULL,
[provincia] [char](2) NULL,
[telefono] [varchar](20) NULL,
[cellulare] [varchar](20) NULL,
[fax] [varchar](20) NULL,
[email] [varchar](200) NULL,
[posizione_aziendale] [varchar](50) NULL,
[persona_di_riferimento] [varchar](30) NULL,
[partita_iva] [varchar](11) NULL,
[codice_fiscale] [varchar](16) NULL,
[iban] [varchar](26) NULL,
[banca] [varchar](40) NULL,
[come_conosciuti] [text] NULL,
[data_attivazione] [date] NULL,
[data_scadenza] [date] NULL,
[modalita_pagamento] [int] NOT NULL,
[listino_applicato] [int] NOT NULL,
[sconto] [int] NOT NULL,
[regione_competenza] [varchar](70) NULL,
[provincia_competenza] [char](2) NULL,
[is_managed] [bit] NOT NULL,
[attrezzature_ricevute] [text] NULL,
[contratto_assistenza] [bit] NOT NULL,
[data_scadenza_assistenza] [date] NULL,
[importo] [money] NULL,
[descrizione] [text] NULL,
[is_client] [bit] NOT NULL,
CONSTRAINT [PK_user_profile] PRIMARY KEY CLUSTERED
(
[UPID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [IX_User_Profiles] UNIQUE NONCLUSTERED
(
[UID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[User_Profiles] ADD CONSTRAINT [DF_user_profile_UID] DEFAULT ((-1)) FOR [UID]
GO
ALTER TABLE [dbo].[User_Profiles] ADD CONSTRAINT [DF_User_Profiles_modalita_pagamento] DEFAULT ((0)) FOR [modalita_pagamento]
GO
ALTER TABLE [dbo].[User_Profiles] ADD CONSTRAINT [DF_User_Profiles_listino_applicato] DEFAULT ((0)) FOR [listino_applicato]
GO
ALTER TABLE [dbo].[User_Profiles] ADD CONSTRAINT [DF_User_Profiles_sconto] DEFAULT ((0)) FOR [sconto]
GO
ALTER TABLE [dbo].[User_Profiles] ADD CONSTRAINT [DF_User_Profiles_is_managed] DEFAULT ((0)) FOR [is_managed]
GO
ALTER TABLE [dbo].[User_Profiles] ADD CONSTRAINT [DF_User_Profiles_contratto_assistenza] DEFAULT ((0)) FOR [contratto_assistenza]
GO
ALTER TABLE [dbo].[User_Profiles] ADD CONSTRAINT [DF_User_Profiles_importo] DEFAULT ((0)) FOR [importo]
GO
ALTER TABLE [dbo].[User_Profiles] ADD CONSTRAINT [DF_User_Profiles_is_client] DEFAULT ((0)) FOR [is_client]
GO
Scusami se son un pò lunghette.