Can we insert one of the columns of a table with select statement with a function?
Posted on 2015-01-04
My requirement is I have an Emp table with 3 columns as shown below.I want to insert some test data.
CREATE TABLE dbo.Emp (
EmployeeNumber Varchar(10) NULL,
LastName Varchar(50) NULL,
Hobby Varchar(max) NULL
I am inserting like this giving me an error.
INSERT INTO dbo.EmployeeHobby
Values('101','Pam','Tom', SELECT REPLICATE('TAP',300))
Since the last coulmn is VARCHAR(MAX),i need to have some test data in the table.