HI, How can I specify wich database to use ?
i'm am making a webapp . each customer get there own database( about 4000 customers).
SO I was wundering can I do
DECLARE @CLAdatabase = test_db
USE @CLAdatabase
GO
SELECT* from
customers
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abdu RafeeqRank #2,262 · 623 reputationPosted Apr 26, 2016, 2:16 AM EDT
Amit KumarRank #459 · 5.4K reputationPosted Apr 26, 2016, 2:28 AM EDT
Cassie ModRank #3,821 · 387 reputationPosted Apr 26, 2016, 2:58 AM EDT
Cassie ModRank #3,821 · 387 reputationPosted Apr 26, 2016, 2:58 AM EDT
ali tuncerRank #1,499 · 1.1K reputationPosted Apr 26, 2016, 5:52 PM EDT
Did you try writing the name of Database in front of Table name, like Abdu suggested?
from [Customer1].dbo.Table1