Forum Replies Created

Viewing 15 posts - 211 through 225 (of 380 total)

  • Reply To: Dates Are Missing Seconds

    Ant-Green wrote:

    Or where you do this

    DECLARE @RECORD_ADD_DT datetime
    SET @RECORD_ADD_DT = @RECORD_ADD_DATE

    do this instead

    DECLARE @RECORD_ADD_DT varchar(26)
    SET @RECORD_ADD_DT = convert(varchar(26),@RECORD_ADD_DATE,121)

    it works now.  I am seeing seconds!! ...

  • Reply To: Dates Are Missing Seconds

    Ant-Green wrote:

    Still think it’s part of the insert in the proc as the convert to char needs to be outside of the dynamic SQL, as for why it was giving...

    • This reply was modified 2 years, 11 months ago by water490.
  • Reply To: Dates Are Missing Seconds

    frederico_fonseca wrote:

    I would say that you have a trigger on that table that is removing seconds from the column.

    and I also assume you are clearing that table in order to...

  • Reply To: Dates Are Missing Seconds

    np

    here you go

    Screenshot 2023-04-24 124527

  • Reply To: Dates Are Missing Seconds

    np

    here you go:

    stored proc:

    ALTER PROCEDURE [dbo].[UpdateOptionsEOD] (@FILENAME varchar(200), @RECORD_ADD_DATE datetime)
    AS

    DECLARE @FILEPATH VARCHAR(200)
    SET @FILEPATH = @FILENAME

    --DECLARE @RECORD_ADD_DT datetime
    --SET @RECORD_ADD_DT = @RECORD_ADD_DATE

    DROP TABLE IF EXISTS #TEMP_TABLE;

    CREATE TABLE #TEMP_TABLE
    (
    [UNDERLYING_SYMBOL] [nvarchar](10)...
  • Reply To: Dates Are Missing Seconds

    I figured out the problem:

    SELECT *, convert(datetime, convert(char(26), ''' + @RECORD_ADD_DT + ''', 121) , 121) AS TIME_STAMP
    FROM #TEMP_TABLE'

    The "" were in the wrong spot.

    The time stamp...

  • Reply To: Dates Are Missing Seconds

    thank you everyone.  I am getting error when I update the dynamic sql.  see below.  Any idea on what is wrong?

    Screenshot 2023-04-24 104016

  • Reply To: Dates Are Missing Seconds

    Phil Parkin wrote:

    Good answer, makes complete sense, thanks for taking the time to write it out.

    There are a couple of points I'd like to mention, however.

    First is that SFTP is completely...

  • Reply To: Dates Are Missing Seconds

    Phil Parkin wrote:

    Taking a step back for a moment ...

    It seems that you are running an SSIS package which calls a proc which runs BULK INSERT – a rather convoluted design....

    • This reply was modified 2 years, 11 months ago by water490.
  • Reply To: Count Number of Records

    Steve Collins wrote:

    water490 wrote:

    I am getting this error.  How do I fix it?

    (573 rows affected)
    Msg 468, Level 16, State 9, Line 14
    Cannot resolve the collation conflict between "Latin1_General_CI_AS"...

    • This reply was modified 2 years, 12 months ago by water490.
  • Reply To: Count Number of Records

    Steve Collins wrote:

    drop table if exists #trades;
    go
    create table #trades(
    underlying_symbol varchar(10) not null,
    trade_date ...
  • Reply To: Joining CTEs Causing Performance Issues

    Thank you both.  The query works now.

  • Reply To: Indexing Tables

    thank you for this.

    I am a rookie so excuse the ignorance.  I need to re-calculate the index after a certain calculation is done.   I thought that using the script...

  • Reply To: Joining CTEs Causing Performance Issues

    for some reason the spacing for some of the lines are messed up.  the words are missing spaces between them.  hopefully this isn't an issue for anyone

  • Reply To: Indexing Tables

    Jonathan AC Roberts wrote:

    If the index doesn't already exist you need to remove DROP_EXISTING = ON from the index creation or set it to OFF.

    If I do that then I get an...

Viewing 15 posts - 211 through 225 (of 380 total)