Page 1 of 1

SQL Complete (2.50.86) Working with Table Variables

Posted: Thu 07 Apr 2011 00:18
by daveb
SQL Prompt does not appear to work well with table variables. For example, formaiting the folllowing:

Code: Select all

CREATE PROCEDURE dbo.Test1 ( @param1 INT
                           , @param2 INT )
AS 
BEGIN
    DECLARE @temp1 TABLE ( col1 INT
                         , col2 INT
                         , col3 INT
                         , col4 INT )

    SELECT  *
    FROM    @temp1 AS t
    WHERE   t1.col1 = @param1
            AND t1.col2 = @parm2

END
GO
Results in:

Code: Select all

CREATE PROCEDURE dbo.Test1(@param1 INT,
                           @param2 INT)
AS
BEGIN
  DECLARE @temp1 TABLE(
	col1 INT
	,
	col2 INT
	,
	col3 INT
	,
	col4 INT
  )

  SELECT *
  FROM @temp1 AS t
  WHERE t1.col1 = @param1
	AND t1.col2 = @parm2

END
GO
In addition, typing "t." after SELECT does not bring up a list of the columns in the @temp1 table.

Posted: Thu 07 Apr 2011 07:51
by .jp
SQL Prompt does not appear to work well with table variables.
...
In addition, typing "t." after SELECT does not bring up a list of the columns in the @temp1 table.
Table variable is a feature of SQL Complete, v2.60 that we are going to release in a few weeks. So, please wait for it.