0
Hello! I am new in sql Transact and would like and have the following situation. I have a table that contains the list of columns in a second table. That’s right! In table B the names of the columns are the same stored in table A. Then use the SELECT information in table B and store in a third table. It would be something like:
@Coluna = SELECT nomecoluna FROM tabelaA;
WHILE (!@Coluna)
BEGIN
INSERT INTO TABLE tabelaC (data, tag)
SELECT data, @Coluna from tabelaB;
END
Note: The column tag in the table will receive the column name as value (@column)
I hope someone will cheer up to help me! Abs!
Check if this can be useful to you:https://answall.com/questions/52800/like-passData
– EmanuelF
Thank you for the answer, but this example ai is only for inserting one table into another. Unfortunately I need something much more complex!
– Sergio Paiva