Query Completed with Errors but no error message

  • I execute a script that someone else wrote and I get Query Completed with Errors but there is not an error message.

    If I highlight and execute parts of the script, it completes successfully.

    I'm surprised that there is not an error message.

    Has anyone seen this before?

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Usually means as a whole, something is wrong. Can't really tell since we can't see what you see.

  • At the bottom of the screen there is yellow bar that includes sections for Query Completed with Errors and a warning symbol followed by the Server Name 10.1 SP1 and the the Login, Database, 00:00:06 and 1 rows.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Welsh Corgi (5/11/2012)


    At the bottom of the screen there is yellow bar that includes sections for Query Completed with Errors and a warning symbol followed by the Server Name 10.1 SP1 and the the Login, Database, 00:00:06 and 1 rows.

    Well, that's really helpful. Still don't see what you see. No code, no tables, no sample data. Unless you want to pay for one us to come visit and watch over your shoulder you really haven't given us much to work with here.

  • I copied the DDL to create the table but when I tried to copy & paste the SQL Statements primarily INSERT Statements it keeps hanging on me.

    I have never seen anything like this where there is not an error on line, etc.

    I have been trying to paste since shortly after your post.

    Since this is not working I guess I will have to fly you out here.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Post removed.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • You said if you ran it in pieces it worked. Starting with the first piece, keep expanding until you have selected the whole script.

  • One example i can think of when see that behavior if you ALTER TABLE , and then insert into the table while referencing the new row; to get it to work, i need a GO statement between the ALTER and subsequent INSERT commands.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • ok here it his. It will probably work on your machine.

    I ran it yesterday with no problem,

    I had to drop all of the objects and recreate today but when I run this script all I get is Query completed with errors and the bottom of the screen on a status bar.

    So do I still nedd to reserve a flight a room and draft a contract?:-)

    CREATE TABLE [dw].[Calendar](

    [Date_ID] [int] NOT NULL,

    [calendar_date] [datetime] NULL,

    [day_num_of_week] [int] NULL,

    [day_num_of_month] [int] NULL,

    [day_num_of_quarter] [int] NULL,

    [day_num_of_year] [int] NULL,

    [day_num_absolute] [int] NULL,

    [day_of_week_name] [varchar](10) NULL,

    [day_of_week_abbreviation] [varchar](3) NULL,

    [julian_day_num_of_year] [int] NULL,

    [weekday_ind] [char](1) NULL,

    [last_day_of_week_ind] [char](1) NULL,

    [last_day_of_month_ind] [char](1) NULL,

    [last_day_of_quarter_ind] [char](1) NULL,

    [last_day_of_year_ind] [char](1) NULL,

    [US_legal_holiday_ind] [char](1) NULL,

    [Holiday_Name] [varchar](30) NULL,

    [week_of_year_begin_date] [datetime] NULL,

    [week_of_year_end_date] [datetime] NULL,

    [week_of_month_begin_date] [datetime] NULL,

    [week_of_month_end_date] [datetime] NULL,

    [week_of_quarter_begin_date] [datetime] NULL,

    [week_of_quarter_end_date] [datetime] NULL,

    [week_num_of_month] [int] NULL,

    [week_num_of_quarter] [int] NULL,

    [week_num_of_year] [int] NULL,

    [month_num_of_year] [int] NULL,

    [month_name] [varchar](10) NULL,

    [month_name_abbreviation] [varchar](3) NULL,

    [month_begin_date] [datetime] NULL,

    [month_end_date] [datetime] NULL,

    [quarter_num_of_year] [int] NULL,

    [quarter_begin_date] [datetime] NULL,

    [quarter_end_date] [datetime] NULL,

    [year_num] [int] NULL,

    [year_begin_date] [datetime] NULL,

    [year_end_date] [datetime] NULL,

    [calendar_date_num] [int] NULL,

    [calendar_date_char] [char](8) NULL,

    [calendar_date_POINT] [char](7) NULL,

    CONSTRAINT [calendar_PK] PRIMARY KEY CLUSTERED

    (

    [Date_ID] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF

    GO

    DROP INDEX calendar_ui ON dw.Calendar;

    DROP INDEX calendar_ui1 ON dw.Calendar;

    DROP INDEX calendar_ui2 ON dw.Calendar;

    DROP INDEX calendar_ui3 ON dw.Calendar;

    insert into dw.calendar(date_id,calendar_date,day_num_of_week,day_num_of_month,day_num_of_quarter,day_num_of_year,day_num_absolute,day_of_week_name,day_of_week_abbreviation,julian_day_num_of_year,weekday_ind,last_day_of_week_ind,last_day_of_month_ind,last_day_of_quarter_ind,last_day_of_year_ind,US_legal_holiday_ind,Holiday_Name,week_of_year_begin_date,week_of_year_end_date,week_of_month_begin_date,week_of_month_end_date,week_of_quarter_begin_date,week_of_quarter_end_date,week_num_of_month,week_num_of_quarter,week_num_of_year,month_num_of_year,month_name,month_name_abbreviation,month_begin_date,month_end_date,quarter_num_of_year,quarter_begin_date,quarter_end_date,year_num,year_begin_date,year_end_date) values(0,cast(null as date),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,cast(null as date),cast(null as date),cast(null as date),cast(null as date),cast(null as date),cast(null as date),null,null,null,null,null,null,cast(null as date),cast(null as date),null,cast(null as date),cast(null as date),null,cast(null as date),cast(null as date));

    insert into dw.calendar(date_id,calendar_date,day_num_of_week,day_num_of_month,day_num_of_quarter,day_num_of_year,day_num_absolute,day_of_week_name,day_of_week_abbreviation,julian_day_num_of_year,weekday_ind,last_day_of_week_ind,last_day_of_month_ind,last_day_of_quarter_ind,last_day_of_year_ind,US_legal_holiday_ind,Holiday_Name,week_of_year_begin_date,week_of_year_end_date,week_of_month_begin_date,week_of_month_end_date,week_of_quarter_begin_date,week_of_quarter_end_date,week_num_of_month,week_num_of_quarter,week_num_of_year,month_num_of_year,month_name,month_name_abbreviation,month_begin_date,month_end_date,quarter_num_of_year,quarter_begin_date,quarter_end_date,year_num,year_begin_date,year_end_date) values(18263,cast('1950-1-1' as date),1,1,1,1,18263,'SUNDAY','SUN',1950001,'N','N','N','N','N','Y','New Years Day',cast('1950-1-1' as date),cast('1950-1-7' as date),cast('1950-1-1' as date),cast('1950-1-7' as date),cast('1950-1-1' as date),cast('1950-1-7' as date),1,1,1,1,'JANUARY','JAN',cast('1950-1-1' as date),cast('1950-1-31' as date),1,cast('1950-1-1' as date),cast('1950-3-31' as date),1950,cast('1950-1-1' as date),cast('1950-12-31' as date));

    insert into dw.calendar(date_id,calendar_date,day_num_of_week,day_num_of_month,day_num_of_quarter,day_num_of_year,day_num_absolute,day_of_week_name,day_of_week_abbreviation,julian_day_num_of_year,weekday_ind,last_day_of_week_ind,last_day_of_month_ind,last_day_of_quarter_ind,last_day_of_year_ind,US_legal_holiday_ind,Holiday_Name,week_of_year_begin_date,week_of_year_end_date,week_of_month_begin_date,week_of_month_end_date,week_of_quarter_begin_date,week_of_quarter_end_date,week_num_of_month,week_num_of_quarter,week_num_of_year,month_num_of_year,month_name,month_name_abbreviation,month_begin_date,month_end_date,quarter_num_of_year,quarter_begin_date,quarter_end_date,year_num,year_begin_date,year_end_date) values(18264,cast('1950-1-2' as date),2,2,2,2,18264,'MONDAY','MON',1950002,'Y','N','N','N','N','N','',cast('1950-1-1' as date),cast('1950-1-7' as date),cast('1950-1-1' as date),cast('1950-1-7' as date),cast('1950-1-1' as date),cast('1950-1-7' as date),1,1,1,1,'JANUARY','JAN',cast('1950-1-1' as date),cast('1950-1-31' as date),1,cast('1950-1-1' as date),cast('1950-3-31' as date),1950,cast('1950-1-1' as date),cast('1950-12-31' as date));

    insert into dw.calendar(date_id,calendar_date,day_num_of_week,day_num_of_month,day_num_of_quarter,day_num_of_year,day_num_absolute,day_of_week_name,day_of_week_abbreviation,julian_day_num_of_year,weekday_ind,last_day_of_week_ind,last_day_of_month_ind,last_day_of_quarter_ind,last_day_of_year_ind,US_legal_holiday_ind,Holiday_Name,week_of_year_begin_date,week_of_year_end_date,week_of_month_begin_date,week_of_month_end_date,week_of_quarter_begin_date,week_of_quarter_end_date,week_num_of_month,week_num_of_quarter,week_num_of_year,month_num_of_year,month_name,month_name_abbreviation,month_begin_date,month_end_date,quarter_num_of_year,quarter_begin_date,quarter_end_date,year_num,year_begin_date,year_end_date) values(18265,cast

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • It did not paste the entire script which is huge.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Lynn Pettis (5/11/2012)


    You said if you ran it in pieces it worked. Starting with the first piece, keep expanding until you have selected the whole script.

    What you suggested is the approach that I normally take however it takes so long seems like hours to scroll down to the end of the script. I have commented out the create indexes at the beginning at and the end of the script. The statements in between are inserts.

    This is very unusual, I sent it back to the Developer who wrote the script but the reason I posted this is because you normally see an error occured on line x, etc, but that is not the case.

    Thanks.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • It turned out to be a memory issue.

    Saved script to the Server and executed and it completed successfully.

    Thanks for your input.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Quite simply you have hidden the Messages panel - try Raising the bottom of the Query Panel and then the Messages will be revealed.

  • nickchance (10/15/2015)


    Quite simply you have hidden the Messages panel - try Raising the bottom of the Query Panel and then the Messages will be revealed.

    This thread is over 3 years old.

    :hehe:

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • It's probably the length of the script.

    I came across this when I had a 45,000-line script. Errored, but with no message.
    The trick is to break it up by adding a 'GO' halfway through the script - it will mean you'll have to re-define any variables required but that shouldn't be a big issue.

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic. Login to reply