INSERT INTO @TempTable

MikeONeillMikeONeill Posts: 131
edited September 29, 2008 3:57PM in SQL Prompt Previous Versions
Hi

If I type INSERT INTO <tableName> I get all the column Names and Stubs for all Values of these column names

If I do the same with INSERT INTO @TempTable , I just get the first column and Values for first column only

Is this a BUG or by design??

SSMS 2005 Sql prompt 3.9.0.43 Pro

Comments

  • Eddie DEddie D Posts: 1,806 Rose Gold 5
    Thank you for your post into the forum.

    Can you please check your syntax. You appear to be referencing a variable called TempTable. The following syntax creates a temporary table:

    USE [databasename]
    GO
    CREATE TABLE #TempTable
    (Col1 varchar(10),
    Col2 decimal (10,2),
    Col3 datetime)
    GO

    When I type INSERT INTO #T, I am correctly prompted for the temporary table and when selected the following appears:

    INSERT INTO #TempTable (
    Col1,
    Col2,
    Col3
    ) VALUES (
    /* Col1 - varchar(50) */ '',
    /* Col2 - decimal (10,2) */ 0,
    /* Col3 - datetime */ '2008-9-29 20:52:49.555' )

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Eddie DEddie D Posts: 1,806 Rose Gold 5
    Thank you for your post into the forum.

    Can you please check your syntax. You appear to be referencing a variable called TempTable. The following syntax creates a temporary table:

    USE [databasename]
    GO
    CREATE TABLE #TempTable
    (Col1 varchar(10),
    Col2 decimal (10,2),
    Col3 datetime)
    GO

    When I type INSERT INTO #T, I am correctly prompted for the temporary table and when selected the following appears:

    INSERT INTO #TempTable (
    Col1,
    Col2,
    Col3
    ) VALUES (
    /* Col1 - varchar(50) */ '',
    /* Col2 - decimal (10,2) */ 0,
    /* Col3 - datetime */ '2008-9-29 20:52:49.555' )

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.