Viewing 15 posts - 2,926 through 2,940 (of 7,614 total)
INSERT INTO [dbo.Distinct_Login] (
[Today], [DatabaseName], [lOGIN_TIME], [HOSTNAME],
[CMD], [NT_USERNAME], [LOGINAME]
)
select
GETDATE() AS today, DB_NAME(dbid) AS DatabaseName, LOGIN_TIME, HOSTNAME,
March 1, 2019 at 11:16 am
Or have SSIS convert that value to a different date. Typically 1900-01-01 is used (date 0 in SQL) for that, unless you have actual data that goes back that far,...
March 1, 2019 at 10:32 am
That's an odd requirement. The same login could have several different processes active on SQL at the same time. How do you want to determine which single one to list? ...
March 1, 2019 at 10:30 am
Something like this instead:
delete from C
from ods_tmus4.dbo.lgtc_shipmentsclaims_cpy C
where exists (
select *
from [Admin].[dbo].[Remove Duplicates_Final] D
Where D.[Tracking_Number] =...
February 27, 2019 at 11:16 am
There is no connection between the table you're deleting from and the EXISTS clause. If the EXISTS is ever true for the tables it references, even for just one row,...
February 27, 2019 at 10:43 am
That's one of the reasons SQL allows NULL "values" in columns (NULL is technically not a value, it's the absence of a value; for day-to-day purposes, you can think of...
February 27, 2019 at 10:41 am
It's easy enough to get a list of the missing values. But getting a concatenated list is somewhat more difficult.
;WITH cte_packages AS (
...
February 26, 2019 at 2:04 pm
The "WITH" from a CTE can cause errors if not preceded by a ; if an actual statement preceded the WITH. Therefore it's safer to prepend a ; so that...
February 25, 2019 at 3:01 pm
February 25, 2019 at 11:13 am
February 25, 2019 at 10:13 am
February 25, 2019 at 7:58 am
February 22, 2019 at 12:14 pm
How do we handle COALESCE in a dynamic SQL query?
In the WHERE clause, don't.
WHERE (@chan_id IS NULL OR tablea.chan_id = CAST(@chan_id AS...
February 22, 2019 at 10:42 am
Viewing 15 posts - 2,926 through 2,940 (of 7,614 total)