Viewing 15 posts - 91 through 105 (of 260 total)
I'm attempting to utilize this query, but I've discovered that HasViewDep is not producing accurate results. Some of the tables are used in inner view select statements (subqueries or...
July 19, 2022 at 11:52 am
Hmmm... That's a strange way to join two tables, but you'll probably have your reasons. It doesn't make sense to me - it seems very arbitrary. Anyway the only thing...
July 15, 2022 at 10:53 pm
Okay, maybe I'm a bit daft, but couldn't you simply use this:
CREATE OR ALTER VIEW Test
AS
SELECT *
FROM Calendar C
LEFT JOIN Events E ON C.CalendarDate BETWEEN E.EventStartDate...
July 15, 2022 at 8:10 pm
Even though the MS documentation states that literals longer than 4000 characters are cast as NVARCHAR(MAX) this doesn't seem to be the case.
July 14, 2022 at 11:49 pm
A slightly different approach
SELECT
CONCAT(SCHEMA_NAME(t.schema_id), '.', t.name) AS TableName
, t.create_date AS CreatedDate
, t.modify_date AS...
July 14, 2022 at 8:03 pm
I'd say its purpuse is to strip leading zeros from (I'm guessing) a numeric string in the col column, i.e. '000001200' becomes '1200'. This is useful for example when processing...
July 13, 2022 at 5:12 pm
With the understanding that I've not done any deep analysis on any of the code posted and going only on what I've seen in the past, the nested REPLACEs...
July 13, 2022 at 3:52 pm
Just to be sure. You want to?
July 12, 2022 at 7:27 pm
Since SQL Server 2016 you can use the STRING_SPLIT() function, which means that you can do something like this:
SELECT * FROM View_Session WHERE BookID IN(SELECT CAST(value AS...
July 12, 2022 at 6:33 pm
A more primitive alternative to the above replies. 🙂
declare @table table (
Number int,
Date1 date,
Date2 date,
...
July 12, 2022 at 5:56 pm
A simple typo I think. If you have just used copy/paste from Ed B's suggested code, the CAST needs a starting paranteses, i.e. CAST(NULL AS VARCHAR(100))
July 8, 2022 at 8:51 pm
This is just a feeling, but I have had the same problem a time or two. Turned out that different default settings of ARITHABORT between SSMS and the application resulted...
June 22, 2022 at 2:35 pm
Or maybe a combination of the proposed queries? Something like
WITH LowestHighest AS (
SELECT MAX (vacationhours) as 'Max_VacationHours', MIN (vacationhours) as 'Min_VacationHours'
From [HumanResources].[Employee]
)
SELECT 'Lowest' AS VacationHoursLeft, e.*, lh.Min_VacationHours AS VacationHours
FROM [HumanResources].[Employee]...
June 21, 2022 at 12:28 pm
Was the WHERE clause allowed when the COLUMNSTORE index was first introduced with SQL Server 2012? I think not, but I haven't been able to find the official MS documentation...
June 21, 2022 at 11:37 am
Alternatively you'll need to use a window function instead of a conventional group by.
June 20, 2022 at 11:00 pm
Viewing 15 posts - 91 through 105 (of 260 total)