Viewing 15 posts - 31 through 45 (of 5,101 total)
I never had any exposure to SQL Server 2000, but my Google-Fu tells me you'll need to use DBCC SHOWCONTIG
(see SQL SERVER – Comparison Index Fragmentation, Index...
April 18, 2023 at 9:18 am
Ooof on the Compatibility 80 level. SQL Server 2008 ran out of support back in 2019, so you really want to get that instance upgraded, but if you're still running...
April 18, 2023 at 8:57 am
Yes i had to do it that way then vendor wants the dates in a specific format and that was the only way I knew how to achive that......
April 13, 2023 at 1:34 pm
[TermDate] = CASE WHEN FORMAT(Termdate, 'MM/dd/yyyy hh:mm:ss') > FORMAT(HireDate, 'MM/dd/yyyy hh:mm:ss')
...
April 13, 2023 at 8:20 am
i have sql server 2012 then how to write this in old syntex
You've posted in the SQL Server 2022 forum, so we've been running under the (incorrect) knowledge that...
April 11, 2023 at 4:40 pm
There are localization differences for the default code page when doing certain type conversions. I was wondered if collation is where that came from when a string is implicitly...
April 11, 2023 at 3:45 pm
Are you saying that the collation impacts the formatting of the date? I haven't really used smalldatetime, that seems like a very microsoft accessy problem to have
The collation, no,...
April 11, 2023 at 2:45 pm
The fields listed in the SELECT
clause are a subset of the fields in the GROUP BY
clause. What you said about DISTINCT
is only necessarily true if the...
April 11, 2023 at 2:00 pm
Why are you using DISTINCT
and GROUP BY
in your first query out of interest? GROUP BY
already puts your data into distinct groups, so the DISTINCT
in the SELECT
...
April 11, 2023 at 11:50 am
select @v=activityname from activity order by activityid
That will assign every value of activityname
to the variable @v
, but as the variable is a scalar value, it...
April 11, 2023 at 10:52 am
One of my biggest pet peeves about (small)datetime
is its handling of the format yyyy-MM-dd( hh:mm:ss)
as it is ambiguous. For those using American as their language they are "fine",...
April 11, 2023 at 10:39 am
please tell me is there anything wrong in first query or should I go for second one or use some with cte etc. etc.
The method you have used in...
April 11, 2023 at 10:11 am
That (now removed) ChatGPT "solution" was amazing garbage...
April 9, 2023 at 2:31 pm
If you're on 2022 then you could use DATE_BUCKET
:
WHERE YourDateTimeColumn >= DATE_BUCKET(DAY,1, GETDATE(), CONVERT(datetime,'19000101 16:00:00'))
AND YourDateTimeColumn < DATEADD(DAY, 1, DATE_BUCKET(DAY,1, GETDATE(), CONVERT(datetime,'19000101 16:00:00')))
Another method would...
April 5, 2023 at 11:47 am
This is literally just a "has anyone else had this thought?" question but I was wondering about "catch-all"/"kitchen-sink" queries at the weekend, and new features of Query Store with the...
April 3, 2023 at 4:25 pm
Viewing 15 posts - 31 through 45 (of 5,101 total)