Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Declare @sql as nvarchar(max)
- Declare @TBL as nvarchar(max)
- Declare @Name_Edit nvarchar(max)
- Declare @Name1 as nvarchar(max)= N'B'
- Declare @Price as nvarchar(max) = N'12'
- Declare @NameTBL as nvarchar(max) = N'KeyBoard'
- set @Name_Edit = N'A'
- set @TBL = N'TBL_Price'+NameTBL
- Set @sql = N'INSERT INTO [DB1].[dbo].'+quotename(@TBL) +'
- (
- [Name_Edit]
- ,[Name1]
- ,[Price]
- )
- VALUES
- (
- '+@Name_Edit+'
- ,'+@Name1+'
- ,'+@Price+'
- )'
- -- exec (@sql)
- EXECUTE sp_executesql @sql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement