Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I’m working in a SQL data base. They are some tables in that data base named Cuestionario1, Cuestionario2, Cuestionario3, …, CuestionarioN. I need to upload them all, but I don´t know how to do it dynamically.
In other words, how can I retrieve the number of Cuestionarios before, in order to reload them.
Thank you all.
Hi,
First you can load all the table names starting with 'Cuestionari' using the below query.
SELECT * FROM sys.Tables where name like ('Cuestionari%')
Then loop through the Name field from the above load and fetch all the tables.
Cheers.
I meant Dynamically.
Hi,
If you know how many tables are there, i mean N you can lopp through using for and next to load the tables.
Can you please elaborate the actual requirement.
Cheers.
That's what I want to know, how many tables they are with that name. Then I'll loop.
Hi,
First you can load all the table names starting with 'Cuestionari' using the below query.
SELECT * FROM sys.Tables where name like ('Cuestionari%')
Then loop through the Name field from the above load and fetch all the tables.
Cheers.