SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE #Customers (ID INT, CustomerName NVARCHAR(400)) ;WITH N1(C) AS (SELECT 0 UNION ALL SELECT 0) ,N2(C) AS (SELECT 0 FROM N1 AS T1 CROSS JOIN N1 AS T2) ,N3(C) AS (SELECT 0 FROM N2 AS T1 CROSS JOIN N2 AS T2) ,N4(C) AS (SELECT 0 FROM N3 AS T1 CROSS JOIN N3 AS T2) ,Ides(ID) AS (SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) FROM N4) INSERT INTO #Customers (ID, CustomerName) SELECT i.ID ,'Customer: ' + TRY_CAST(i.ID AS NVARCHAR) FROM Ides i; SELECT * FROM #Customers c

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear