Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to use a variable as Table Name in an INSERT INTO query

RayBanRayBan Member Posts: 7
Hi,

How to use a variable as a Table Name in an INSERT INTO QUERY :

SET @MachineName = 'CBC'
SET @MyTableName = 'T_Journal_' + @MachineName

INSERT INTO @MyTableName (
MyVal
)
Values(
1
)

Any ideas ?

Ray


Comments

Sign In or Register to comment.