title: SQL UniqueIdentifier
body: <p>I have a table called <code>UserCredentials</code> and it has a <code>uniqueidentifier</code> column <code>[UserCredentialId]</code>. When I try to create a new user, I get <code>00000000-0000-0000-0000-000000000000</code> in my first try, then when I try adding another user, it says PK cannot be duplicated. At first I had a hard time guessing what does it mean but, I think its because of my <code>uniqueidentifier</code> is not generating random id. </p>
  
  <p>What to do?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is my SQL table structure:</p>
  
  <pre><code>CREATE TABLE [dbo].[UserCredential](
      [UserCredentialId] [uniqueidentifier] NOT NULL,
      [UserRoleId] [int] NOT NULL,
      [Username] [varchar](25) NOT NULL,
      [Password] [varchar](50) NOT NULL,
      [PasswordSalt] [varchar](max) NOT NULL,
      [FirstName] [varchar](50) NOT NULL,
      [LastName] [varchar](50) NOT NULL,
      [PayorCode] [varchar](20) NOT NULL,
      [ProviderCode] [varchar](50) NULL,
      [CorporationCode] [varchar](50) NULL,
      [Department] [varchar](50) NULL,
      [Status] [varchar](1) NOT NULL,
      [DateCreated] [datetime] NOT NULL,
      [DateActivated] [datetime] NULL,
      [Deactivated] [datetime] NULL,
      [DateUpdated] [datetime] NULL,
      [CreatedBy] [varchar](50) NOT NULL,
      [UpdatedBy] [varchar](50) NOT NULL,
      [EmailAddress] [varchar](50) NULL,
      [ContactNumber] [int] NULL,
      [Picture] [varbinary](max) NULL,
   CONSTRAINT [PK_UserCredential_1] PRIMARY KEY CLUSTERED 
  (
      [UserCredentialId] ASC
  )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  </code></pre>
  
  <p>I already set it to (<code>newid()</code>) but still not working.</p>