Vikas Kumar
New Member
- Joined
- Apr 2, 2017
- Messages
- 49
Hi,
I am trying to copy one table's records into a variable named table as below,
Here Source Table is 'Samples' and wants to get all its records into '@testing' Table. But it gives an error 'Incorrect syntax near '@testing'
I'm on Sql server 2014. Any help would be appreciated.
Thanks.
I am trying to copy one table's records into a variable named table as below,
Declare @Testing Varchar(20)
Set @Testing = 'Mytable'
Select * into @Testing from samples where 1=1
Here Source Table is 'Samples' and wants to get all its records into '@testing' Table. But it gives an error 'Incorrect syntax near '@testing'
I'm on Sql server 2014. Any help would be appreciated.
Thanks.