Click here to Skip to main content
15,886,919 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL behind the scenes Pin
RedDk17-Jan-24 8:30
RedDk17-Jan-24 8:30 
AnswerRe: SQL behind the scenes Pin
Eddy Vluggen18-Jan-24 7:33
professionalEddy Vluggen18-Jan-24 7:33 
GeneralRe: SQL behind the scenes Pin
jschell19-Jan-24 4:52
jschell19-Jan-24 4:52 
QuestionRe: SQL behind the scenes Pin
Eddy Vluggen10-Feb-24 10:08
professionalEddy Vluggen10-Feb-24 10:08 
QuestionSql Server Database goes into Recovery mode Pin
Nilesh M. Prajapati17-Nov-23 17:59
Nilesh M. Prajapati17-Nov-23 17:59 
AnswerRe: Sql Server Database goes into Recovery mode Pin
Andre Oosthuizen18-Nov-23 7:35
mveAndre Oosthuizen18-Nov-23 7:35 
AnswerRe: Sql Server Database goes into Recovery mode Pin
Mycroft Holmes18-Nov-23 11:38
professionalMycroft Holmes18-Nov-23 11:38 
AnswerRe: Sql Server Database goes into Recovery mode Pin
CHill6020-Nov-23 4:10
mveCHill6020-Nov-23 4:10 
As has already been pointed out to you, that design is a bad idea. See SQL Server: The Problems of Having Thousands of Databases on a Single Instance[^]
It's bad for lots of other reasons too. Say you wanted to produce some MI for an entire year's worth of data for your application. You would have to query 12 separate databases ending up with something like
SQL
SELECT Col1, Col2 FROM DB1.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB2.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB3.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB5.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB6.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB7.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB8.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB9.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB10.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB11.dbo.MyTable
UNION ALL
SELECT Col1, Col2 FROM DB12.dbo.MyTable;
And did you spot my deliberate mistake?

Even if you have a new table in the same database each month it doesn't really get any better...
SQL
SELECT Col1, Col2 FROM MyTable01
UNION ALL
SELECT Col1, Col2 FROM MyTable02
UNION ALL
SELECT Col1, Col2 FROM MyTable03
UNION ALL
SELECT Col1, Col2 FROM MyTable04
UNION ALL
SELECT Col1, Col2 FROM MyTable06
UNION ALL
SELECT Col1, Col2 FROM MyTable08
UNION ALL
SELECT Col1, Col2 FROM MyTable09
UNION ALL
SELECT Col1, Col2 FROM MyTable10
UNION ALL
SELECT Col1, Col2 FROM MyTable11
UNION ALL
SELECT Col1, Col2 FROM MyTable12;
But introduce a Date column into your table and suddenly your code becomes so much clearer
SQL
SELECT Col1, Col2, YEAR(MyDate), MONTH(MyDate) FROM MyTable;
Next steps are to look at normalizing your single table - see Database normalization description - Microsoft 365 Apps | Microsoft Learn[^] for some starters.

Address these sort of problems first, to take some of the heavy lifting off your SQL Server instance and you might very well cure what ever it is that is going wrong for you.

Failing that you are going to have to examine the Windows Application log to find out more - View the Windows application log (Windows) - SQL Server | Microsoft Learn[^]
AnswerRe: Sql Server Database goes into Recovery mode Pin
jschell20-Nov-23 7:48
jschell20-Nov-23 7:48 
QuestionSQLite Thread Safety Pin
Richard Andrew x6410-Nov-23 12:23
professionalRichard Andrew x6410-Nov-23 12:23 
AnswerRe: SQLite Thread Safety Pin
Gerry Schmitz10-Nov-23 14:04
mveGerry Schmitz10-Nov-23 14:04 
GeneralRe: SQLite Thread Safety Pin
Richard Andrew x6410-Nov-23 15:33
professionalRichard Andrew x6410-Nov-23 15:33 
GeneralRe: SQLite Thread Safety Pin
Gerry Schmitz13-Nov-23 11:14
mveGerry Schmitz13-Nov-23 11:14 
AnswerRe: SQLite Thread Safety Pin
Jörgen Andersson12-Nov-23 21:16
professionalJörgen Andersson12-Nov-23 21:16 
QuestionSQLite syntax error that I can't figure out - SOLVED Pin
Richard Andrew x644-Nov-23 14:09
professionalRichard Andrew x644-Nov-23 14:09 
AnswerRe: SQLite syntax error that I can't figure out Pin
k50544-Nov-23 17:22
mvek50544-Nov-23 17:22 
GeneralRe: SQLite syntax error that I can't figure out Pin
Richard Andrew x645-Nov-23 1:57
professionalRichard Andrew x645-Nov-23 1:57 
Questionplease Pin
daw htikehtike21-Oct-23 19:17
daw htikehtike21-Oct-23 19:17 
AnswerRe: please Pin
Richard MacCutchan21-Oct-23 21:14
mveRichard MacCutchan21-Oct-23 21:14 
AnswerRe: please Pin
jschell23-Oct-23 5:25
jschell23-Oct-23 5:25 
AnswerRe: please Pin
Gerry Schmitz24-Oct-23 7:15
mveGerry Schmitz24-Oct-23 7:15 
AnswerRe: please Pin
CHill6029-Oct-23 23:44
mveCHill6029-Oct-23 23:44 
QuestionGetting Last Record and First Record from a Record Set (SQL server DB) Pin
Member 1184335621-Sep-23 8:07
Member 1184335621-Sep-23 8:07 
AnswerRe: Getting Last Record and First Record from a Record Set (SQL server DB) Pin
Richard Andrew x6421-Sep-23 8:58
professionalRichard Andrew x6421-Sep-23 8:58 
GeneralRe: Getting Last Record and First Record from a Record Set (SQL server DB) Pin
Member 1184335621-Sep-23 9:18
Member 1184335621-Sep-23 9:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.