Viewing 15 posts - 541 through 555 (of 7,608 total)
I agree that the model is not technically valid. But I take it this is more a class / fictional "design" than a real-world implementation.
February 2, 2023 at 8:29 pm
For many practical reasons, just use an int like the rest of the world does. Besides which, the SQL DDL Celko gave above: "allow stuff like "sauerkraut" to be a[n...
February 2, 2023 at 8:28 pm
I've added comments to your code below. Some of the code is invalid and/or doesn't make sense.
create procedure AppendAccountCommissionHistory
as
begin
begin
insert into...
February 2, 2023 at 6:02 pm
You could create a combined table. I assume (perhaps wrongly, if so, correct me) that you will have fewer than 10 professors in the table and therefore you intend that...
February 2, 2023 at 3:15 pm
SELECT ZipCode, COUNT(DISTINCT DATEADD(MONTH, DATEDIFF(MONTH, 0, UCLogTimeStamp), 0)) AS 'No. months'
FROM #mytable
GROUP BY ZipCode
January 31, 2023 at 3:41 pm
I'm so sorry guys, wrong CASE
(CASE WHEN CAST(DH.OPENING_HOUR_H AS INT) BETWEEN 10 AND 16 THEN 'Lunch' WHEN CAST(DH.OPENING_HOUR_H AS INT) BETWEEN 16 AND 19 THEN 'Snack' ELSE 'Dinner'...
January 29, 2023 at 5:20 pm
Sorry, but a picture of data is useless to us. Please post usable data, that is, a CREATE TABLE and INSERT statement(s).
January 28, 2023 at 9:52 pm
It should work I think. But 0x55555 is an odd number of chars, so the value would actually get set to 0x055555.
Try setting it to 0x555555, that should work more...
January 27, 2023 at 3:36 pm
I just did a few sample rows, I'm not going to type in all that data.
DROP TABLE IF EXISTS #data;
CREATE TABLE #data ( ENTRY_HOUR tinyint NULL, ENTRY_MINUTE...
January 25, 2023 at 4:01 pm
You cannot update the value of an identity column. You would to insert a new row and delete the old row. That will be way too much overhead.
And, as Thom...
January 23, 2023 at 2:43 pm
...but I don't think I'll ever be converted to leading commas - I think that's at least partly because I'm an English language pedant and believe that a...
January 22, 2023 at 8:42 pm
I wouldn't just arbitrarily add a non-clus index without checking existing index usage ("index usage stats") AND reviewing missing indexes ("missing index" stats).
January 20, 2023 at 8:14 pm
Anyway, my question is to do with square brackets and including schema names. ... My inclination is to leave off as much stuff as possible (he also used to...
January 20, 2023 at 8:10 pm
How do you typically query the table? If you normally query by a range of datetime, then changing the clus index makes perfect sense.
First, change the SET @table_name_pattern = '%'...
January 20, 2023 at 3:57 pm
Something like this. The key is using aliases (AS ...) for the tables to make the code easier to write and to follow:
SELECT t0.column1, t1.Description, t2.Description, ...
FROM...
January 18, 2023 at 9:48 pm
Viewing 15 posts - 541 through 555 (of 7,608 total)