Viewing 15 posts - 436 through 450 (of 7,614 total)
For a specific day, then:
Select
Name
,Login_Email_Address
,CAST(Date AS date) AS Date
from User_acticvity
Group By Name, Login_Email_Address, CAST(Date AS date) AS Date
Having Sum(Case When action = 'Login' Then 1 Else 0...
May 25, 2023 at 4:57 pm
I suggest you consider "ingredients" as an entity rather than separate "items" and "fluids". ingredient would be a super-type, with sub-types of either item or fluid, while allowing for other...
May 21, 2023 at 4:54 pm
Since you didn't put aliases on the column names, I (we) have NO idea which table each column comes from; therefore, I had to use xx. as a dummy/generic alias.
I...
May 19, 2023 at 7:46 pm
Cool, I can help more/fully with SQL Server:
SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
GO
CREATE TRIGGER dbo.trigger_name
ON dbo.table_name
AFTER INSERT
AS
UPDATE tn
SET col1=GETDATE(), col2=0, col3='' /*, ...*/
FROM dbo.table_name tn
INNER JOIN inserted i...
May 19, 2023 at 1:45 pm
Which dbms are you using? SQL Server? Access? Oracle?
This is a SQL Server forum. Someone here might be able to help you with another dbms, but less so than with...
May 19, 2023 at 1:30 pm
That's very odd. Could you provide the CREATE INDEX command you are using (naturally change names as needed to protect your actual object/column names).
May 19, 2023 at 1:28 pm
Normally you'd just specify a default value rather than having to use a trigger for that.
For example, say you have table "tableA" that you want to add a default value...
May 19, 2023 at 1:01 pm
You can adjust the SUM(s). I wasn't sure if you wanted to list only the net or all three; if you want only the net, remove the first two "OH"...
May 17, 2023 at 2:22 pm
I admit that for Medicare patients, as specified by the author, SSN might be valid to use (to be eligible, a person would need an SSN (or perhaps a TIN)). ...
May 15, 2023 at 4:04 pm
More specifically, if you need to fully shrink a log, do something like this:
--assume you want log to be 3GB after shrink
USE database_name;
DBCC SHRINKFILE(2);
--explicitly increase the log...
May 13, 2023 at 2:49 pm
Change the size to a fixed MB - then shrink the file to as small as...
May 12, 2023 at 8:33 pm
SQL can usually imbed the conditions into the query plan to access the table rather than scanning the entire table first. Of course you'd have to look at the query...
May 12, 2023 at 5:25 pm
This does look like something maybe outside of SQL Server?!
Although, in order to truncate the log, a checkpoint must be taken after backup. So step 4b. should be a CHECKPOINT,...
May 10, 2023 at 8:49 pm
Yes, the script is 100% safe to run in a prod environment.
It does change a couple of settings for max efficiency, but first it captures the current settings and reinstates...
May 10, 2023 at 2:43 pm
Viewing 15 posts - 436 through 450 (of 7,614 total)