Skip to content

Settings and activity

2 results found

  1. 74 votes
    Vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    8 comments  ·  SQL Compare  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    James Strath supported this idea  · 
    An error occurred while saving the comment
    James Strath commented  · 

    Absolutely! Such a feature would be most welcome.

  2. 2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    3 comments  ·  SQL Prompt  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    James Strath commented  · 

    Can remove the warning from MIN/MAX also by not initializing when declaring the variable , but I'd rather keep to the original syntax style

    no squiggly line in this example

    DECLARE @foo INT

    SELECT @foo = (MAX([value].[val]))
    FROM (VALUES(1),(2),(3))AS[value]([val])

    SELECT @foo

    squiggly line for this preferred syntax:

    DECLARE @foo INT = (
    SELECT (MAX([value].[val]))
    FROM (VALUES(1),(2),(3))AS[value]([val])
    )
    SELECT @foo

    An error occurred while saving the comment
    James Strath commented  · 

    IF EXISTS(SELECT (1) FROM sys.objects [o] WHERE (SCHEMA_NAME([o].[schema_id]) = (N'dbo')) AND [o].[name] = (N'fn_myfunc') AND [o].[type]=(N'FN')) DROP FUNCTION [dbo].[fn_myfunc];
    GO
    CREATE FUNCTION [dbo].[fn_myfunc] ()
    RETURNS NVARCHAR(11)
    AS BEGIN
    RETURN(N'hello world')
    END
    GO
    ;DECLARE @HasWarning nvarchar(11) = (SELECT [dbo].[fn_myfunc]())
    ;PRINT(@HasWarning)
    ;DECLARE @NoWarning nvarchar(11) = ([dbo].[fn_myfunc]())
    ;PRINT(@NoWarning)

    An error occurred while saving the comment
    James Strath commented  · 

    eg.

    DECLARE @foo INT = (
    SELECT (MAX([value].[val]))
    FROM (VALUES(1),(2),(3))AS[value]([val])
    )
    SELECT @foo

    James Strath shared this idea  ·