CREATE proc createtable
as
begin
DECLARE @SQLString NVARCHAR(MAX)
SET @SQLString = 'CREATE TABLE Tab_'+convert(varchar,getdate(),112) + '( id bigint,name varchar(200))'
EXEC sp_executesql @SQLString
end
output :
This blog show the simple example to create dynamically table name in sql server
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegisterMembers onlyeBook · .NETCQRS Design Pattern with MediaRDownload nowWrite a blog post and earn +250 SHARP when it is approved.
Write a blog
Arjun DhilodPosted Feb 9, 2014, 10:28 PM EST
okey thank you for reply
Priti KumariPosted Feb 9, 2014, 10:22 PM EST
above example help you to create dynamic table in Sql
Arjun DhilodPosted Feb 9, 2014, 9:29 PM EST
hi you know How to create dynamic table in mssql and insert value from textfiled using C#?