'When inserting a result of a query, how do I insert random exact numbers?

I can use IDENTITY to generate unique ID numbers, but is there a way to generate a completely random number when inserting data? Currently, all ID's start with "1000"

Here is my original table:

CREATE TABLE Badges
(ID INTEGER IDENTITY(1000000000,23),
EmpID INTEGER NOT NULL,
EmpName nvarchar(50) not null,
EmpLastName nvarchar(50) not null,
IssueDate date default getdate(),
Validity char(1) default 'Y',
CONSTRAINT STATUS_CHECK check (Validity in ('Y','N')))

Below is my attempt to set up random ID number generation. I also tried to nest RAND into IDENTITY, but it did not work. Probably incorrect syntax, not so sure.

CREATE TABLE Badges
(Badge_ID INTEGER DEFAULT ROUND(RAND()*100000000,0) UNIQUE,
EmpID INTEGER NOT NULL,
EmpName nvarchar(50) not null,
EmpLastName nvarchar(50) not null,
IssueDate date default getdate(),
Validity char(1) default 'Y',
CONSTRAINT ID_status CHECK(Validity in ('Y','N')));

For a test, I tried inserting all employees from department 8 but now it generates the same Badge_ID number for everybody, at least if I insert employees in bulk and not one by one.

INSERT INTO Badges (EmpID, EmpName, EmpLastName)
SELECT EmployeeID, FirstName, LastName FROM HR.Employee WHERE DepartmentID = 8 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source