Forum Replies Created

Viewing 15 posts - 46 through 60 (of 5,109 total)

  • Reply To: The place of SMALLDATETIME

    CreateIndexNonclustered wrote:

    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,...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: cross join sql

    drew.allen wrote:

    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...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: cross join sql

    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...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: How to get top 100 values of a col concatenated in a variable in sqlserver?

    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...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: The place of SMALLDATETIME

    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",...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: How to get top 100 values of a col concatenated in a variable in sqlserver?

    rajemessage 14195 wrote:

    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...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: SQL to set date/time period to 1600-1559 (dynamic)

    That (now removed) ChatGPT "solution" was amazing garbage...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: SQL to set date/time period to 1600-1559 (dynamic)

    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...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: Are the posted questions getting worse?

    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...

    • This reply was modified 3 years, 2 months ago by Thom A.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: Commvault thinks log chain broken, launches full backup during business day

    vinchackochandy wrote:

    Any fix regarding this thread?

    We are frequently facing this issue.

    Considering this is a 12 year old thread, I'd suggest either starting a new one as things could easily have...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: Triggers In Sql

    You're assuming an INSERT/UPDATE only ever effects one row; this is completely untrue. You are then trying to assign values to your scalar variables from CROSS JOINed queries. Take your...

    • This reply was modified 3 years, 3 months ago by Thom A.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: ChatGPT in SQL Server - Practical examples

    cmgreenjr wrote:

    I was trying to reply to 3 different posts.  The way the responses showed up looks like i just put a similar answer 3 times together.

    If you want to...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: ChatGPT in SQL Server - Practical examples

    cmgreenjr wrote:

    Using the 'CoPilot' version of ChatGPT ( that is an addon to Microsoft Visual Studio) trained in programming and with access to the data sources this is possible now.

    As...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: ChatGPT in SQL Server - Practical examples

    Honestly, the fact that ChatGPT makes the mistake of thinking that people age on 01 Jan, which is such a fundamental error, show that it can't be relied on when...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Reply To: Code to sum hours and minutes (varchar), 800,000 rows.

    Teewhy wrote:

    Secondly, the data was imported from excel in hh:mm format but it is coming up in sql as varchar.

    I have tried casting it as int in sql to...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 15 posts - 46 through 60 (of 5,109 total)