Skip to navigation
Check if a list of table colums exists in a database
08.08.18
1. create query list with https://sqlmaker.salamander-jewelry.com/ 2. use this list to import into a temp table drop table #temp CREATE TABLE #temp ( t varchar(255) ,c varchar(255) ,e int ) INSERT INTO #temp (t,c,e) select 'F331_125previous_transaction_stone','tn1_color',COL_LENGTH('F331_125previous_transaction_stone','tn1_color') AS exist UNION select 'F331_125previous_transaction_stone','tn1_date',COL_LENGTH('F331_125previous_transaction_stone','tn1_date') AS exist UNION select 'F331_125previous_transaction_stone','tn1_location',COL_LENGTH('F331_125previous_transaction_stone','tn1_location') AS exist UNION select 'F331_125previous_transaction_stone','tn1_qty_stone',COL_LENGTH('F331_125previous_transaction_stone','tn1_qty_stone') AS exist UNION select 'F331_125previous_transaction_stone','tn1_quality',COL_LENGTH('F331_125previous_transaction_stone','tn1_quality') AS exist UNION select 'F331_125previous_transaction_stone','tn1_shape',COL_LENGTH('F331_125previous_transaction_stone','tn1_shape') AS exist UNION select 'F331_125previous_transaction_stone','tn1_stone_code',COL_LENGTH('F331_125previous_transaction_stone','tn1_stone_code') AS exist UNION select * from #temp where e is NULL
https://sqlmaker.salamander-jewelry.com/
Reply
Anonymous
select '{}','{}',COL_LENGTH('{}','{}') AS exist UNION
08.08.18
Reply
Anonymous
Information Epoch 1732659729
Worse is better.
Home
Notebook
Contact us