Viewing 15 posts - 2,716 through 2,730 (of 7,614 total)
It's best to stop using INFORMATION_SCHEMA views. They can contain inaccuracies (on ownership) and are incomplete now.
Stick to sys.columns and the other MS standard views.
September 4, 2019 at 6:23 pm
I guessed you would want to sort/order by Item first; if not, you might want to reverse the GROUP BY to Name, Item.
SELECT Item, Name,
...
September 4, 2019 at 6:21 pm
The server has a database that is several hundred GB in size, so it's amazing that the server is even running at all.
Heh... while the world insists that...
September 4, 2019 at 6:15 pm
A bit tricky really, unless you want to take the 90 separate log files approach.
For example, if you set a job to cycle the log every 15 days, then the...
September 3, 2019 at 8:21 pm
I recommend one simplification to make your SQL coding and maintenance easier: use "*" in the inner query using ROW_NUMBER(). SQL will still only actually retrieve the data that is...
September 3, 2019 at 7:43 pm
I believe so. Just use the standard SQL command to add a file(s):
ALTER DATABASE tempdb ADD FILE
( NAME = ..., FILENAME = '...' , SIZE = nnnMB, ... ),
( NAME...
September 3, 2019 at 5:08 pm
Worked on my SQL 2016 too.
Just to be safe, add the N in front of the second literal:
SELECT 1 WHERE JSON_VALUE( '{"id":"1","name":"me"}' , N'$.id' ) = '1'
August 28, 2019 at 4:42 pm
As I understand it, if multiple matches are possible, SQL can match any row. That is, the results are unknown and you should assume they are effectively random.
Similarly, if you...
August 27, 2019 at 6:27 pm
I think a smallint would suffice for language code. I can't imagine there being more than 64K languages (including negative values if absolutely necessary).
August 27, 2019 at 4:38 pm
Typically one would use a bit value setting to reduce space usage. For example:
languages int NOT NULL
You'd want a separate table with the language code values:
CREATE TABLE #language_codes...
August 26, 2019 at 10:43 pm
Again, very bad idea trying to combine all three actions, even for one table, let alone for all tables.
It's easy enough to generate individual procs. If you wanted to, you...
August 26, 2019 at 10:36 pm
Typically one would use a bit value setting to reduce space usage. For example:
languages int NOT NULL
You'd want a separate table with the language code values:
CREATE TABLE #language_codes ( language_bit...
August 26, 2019 at 6:22 pm
I suppose you could force that to work, but it's a bad idea. Individual tables have vastly different columns and requirements.
August 26, 2019 at 6:13 pm
The major problem with your first query is that it doesn't satisfy the original conditions to: select all rows if the value is NULL. Other than dynamic SQL, the scan...
August 22, 2019 at 6:41 pm
Of course bad triggers can be written. Bad stored procedures can also be written, but that doesn't mean we should quit writing stored procedures (agreed?). Yes, take great care to...
August 22, 2019 at 3:27 pm
Viewing 15 posts - 2,716 through 2,730 (of 7,614 total)