execute current statement fails

torsten.strausstorsten.strauss Posts: 271 Silver 3
edited November 8, 2016 6:39AM in SQL Prompt
Hi !

Execute current statement will not work for this code but executing from SSMS will work:

CREATE VIEW dm_db_index_usage_stats
AS
SELECT
i.name AS index_name
, i.index_id
, i.type_desc AS index_type_description
, i.is_unique
, i.is_primary_key
, DB_NAME(ius.database_id) AS database_name
, ius.object_id
, OBJECT_NAME(ius.object_id, ius.database_id) AS object_name
, ius.user_seeks
, ius.user_scans
, ius.user_lookups
, ius.user_updates
, ius.last_user_seek
, ius.last_user_scan
, ius.last_user_lookup
, ius.last_user_update
FROM
sys.dm_db_index_usage_stats ius
INNER JOIN
sys.indexes i
ON
ius.index_id = i.index_id
AND ius.object_id = i.object_id
;

Thanks for investigation!

Comments

  • Aaron LAaron L Posts: 596 New member
    Hi Torsten,

    We've having difficulty reproducing this here unfortunately as it seems to execute without a problem.

    I'm wondering if there was something else in the query that might have caused a syntax error - If you open a new query window and just paste the statement in your previous post in do you still get an error when you run execute current statement?

    Thanks,
    Aaron.
  • Hi Aaron,

    after installing the latest beta version 7.3.0.633 it is fixed.

    BTW. I am still looking for an option to copy the redgate about information esp. the version number !

    Thanks for your support!
  • Aaron LAaron L Posts: 596 New member
    Hi Torsten,

    That's good to hear! I think you can double click on the version number in the about box to copy it to the clipboard?

    Thanks,
    Aaron.
Sign In or Register to comment.