locked
SQL Server Script error RRS feed

  • Question

  • BEGIN TRAN;

    INSERT INTO [dbo].[QuestManualProcess]
               ([ProcessFromDate]
               ,[LastProcessedFileDateStamp]
               ,[ProcessedOnDate]
               ,[CreatedOnDate]
               ,[CreatedByUserID]
               ,[ModifiedOnDate]
               ,[ModifiedByUserID])
         VALUES
               (<2015-09-12, date,>
               ,<NULL, varchar(12),>
               ,<NULL, datetime,>
               ,<GETDATE(), datetime,>
               ,<xxxxxx, varchar(250),>
               ,<GETDATE(), datetime,>
               ,<xxxxxxx, varchar(250),>)
    GO

    Error Message 

    Msg 241, Level 16, State 1, Line 2
    Conversion failed when converting date and/or time from character string.

    Can you guys help me with this

    Monday, September 14, 2015 5:38 PM

Answers

  • BEGIN TRAN;
    
    
    INSERT INTO [dbo].[QuestManualProcess]
                ([ProcessFromDate]
                ,[LastProcessedFileDateStamp]
                ,[ProcessedOnDate]
                ,[CreatedOnDate]
                ,[CreatedByUserID]
                ,[ModifiedOnDate]
                ,[ModifiedByUserID])
          VALUES
                ('2015-09-12'
                ,NULL
                ,NULL
                ,GETDATE()
                ,'xxxxxx'
                ,GETDATE()
                ,'xxxxxxx')
     GO


    A Fan of SSIS, SSRS and SSAS

    • Marked as answer by Reddy435 Monday, September 14, 2015 6:35 PM
    Monday, September 14, 2015 5:46 PM
  • BEGIN TRAN; INSERT INTO [dbo].[QuestManualProcess] ([ProcessFromDate] ,[LastProcessedFileDateStamp] ,[ProcessedOnDate] ,[CreatedOnDate] ,[CreatedByUserID] ,[ModifiedOnDate] ,[ModifiedByUserID]) VALUES ('2015-09-12' ,NULL ,NULL ,GETDATE() ,'xxxxxx' ,GETDATE() ,'xxxxxxx') GO

    LastProcessedFileDateStamp should take care where data type is varchar(12).


    Please click "Mark As Answer" if my post helped.

    • Marked as answer by Reddy435 Monday, September 14, 2015 6:36 PM
    Monday, September 14, 2015 6:10 PM

All replies

  • BEGIN TRAN;
    
    
    INSERT INTO [dbo].[QuestManualProcess]
                ([ProcessFromDate]
                ,[LastProcessedFileDateStamp]
                ,[ProcessedOnDate]
                ,[CreatedOnDate]
                ,[CreatedByUserID]
                ,[ModifiedOnDate]
                ,[ModifiedByUserID])
          VALUES
                ('2015-09-12'
                ,NULL
                ,NULL
                ,GETDATE()
                ,'xxxxxx'
                ,GETDATE()
                ,'xxxxxxx')
     GO


    A Fan of SSIS, SSRS and SSAS

    • Marked as answer by Reddy435 Monday, September 14, 2015 6:35 PM
    Monday, September 14, 2015 5:46 PM
  • BEGIN TRAN; INSERT INTO [dbo].[QuestManualProcess] ([ProcessFromDate] ,[LastProcessedFileDateStamp] ,[ProcessedOnDate] ,[CreatedOnDate] ,[CreatedByUserID] ,[ModifiedOnDate] ,[ModifiedByUserID]) VALUES ('2015-09-12' ,NULL ,NULL ,GETDATE() ,'xxxxxx' ,GETDATE() ,'xxxxxxx') GO

    LastProcessedFileDateStamp should take care where data type is varchar(12).


    Please click "Mark As Answer" if my post helped.

    • Marked as answer by Reddy435 Monday, September 14, 2015 6:36 PM
    Monday, September 14, 2015 6:10 PM
  • Please share table definition of table - [dbo].[QuestManualProcess]

    UY420

    Monday, September 14, 2015 8:32 PM