Tag Info

New answers tagged

0

I agree with "bad form". Plan A: Here's another approach when you do need to add another column(s). Create a new table with the same PRIMARY KEY ("Vertical partition"). (But not AUTO_INCREMENT.) Put the new column(s) in it. The JOIN to fetch the new data will be messy in your code, but only when you actually need those new columns. Also, make it a ...


2

This should solve the problem for you exactly. Obviously if you are restoring to a database where the mdf/ldf are differently named you may need to adjust the final restore command slightly. This just works by listing out the backups in a directory and picking based on a pattern. I guess i could have made the pattern a variable too but you get the point. ...


6

The DBA's here are probably going to throw eggs and tomatoes at me but I'm going to throw this out there anyway. You could use and integration services job to run this. First create a for Each file loop and set it to run for each file in that location. Map the result to a variable. Then create and Execute SQL Task within the container. Once that's ...


7

Since all the details on backups are maintained in the msdb database, you should just extract the backup file name from the source server. You could create a linked server from your Dev Server to access the Production Server's msdb database. Or you can use OPENQUERY to query the same data. (OPENQUERY may be faster since the query is actually being run on ...


2

I echo the "bad form" comment of @JohnM - design the thing properly, and if you have new requirements (or your design isn't perfect first time - unlikely I know :-) ), then choose to add new fields. Use JSON if it suits your clearly demonstrated requirements, otherwise stick with "normal" field types. I've seen too many systems where these "spare fields" ...


2

Firstly, make sure the account executing the job has sufficient privileges to run alter index. If that fails, then find the index "DTA_reports_indexcolumn_index2" and see if you can rebuild it yourself by hand. If that works, then you may have another process hitting this table at the same time the index maintenance is running. You'll have to look through ...


3

You're confusing a few terms, I think. The ndf file is not an "index file", it is just another database data file to house the data. It sounds like you have two database data files (the MDF and NDF). With the size of your MDF being so small, my guess would be that your database has two different filegroups (the PRIMARY filegroup using the MDF, and the ...



Top 50 recent answers are included