I tried to create a INSERT INTO statement which gets its data from another data (partially).

I started typing INSERT INTO T_Transl.... and then picked the T_Translation table - worked fine, showed me all the columns in that table. I picked those needed, and went on to write the SELECT....... to select the values from the other table.

I had typed this:

insert into dbo.T_Translation(Code, Caption, LanguageOID,IsEdited)
SELECT
'ABC', 'Abc 1-2-3', OID, 1
FROM
dbo.T_Language

and then pressed <ENTER> to select the T_Language table, and the statement was completed with:

( OID ,
Caption ,
LCID ,
SortOrder ,
UserOIDStamp ,
DateTimeStamp ,
ISOLanguage
)
VALUES ( NULL , -- OID - uniqueidentifier
'' , -- Caption - varchar(100)
0 , -- LCID - int
0 , -- SortOrder - smallint
NULL , -- UserOIDStamp - uniqueidentifier
'2009-06-09 08:27:56' , -- DateTimeStamp - datetime
'' -- ISOLanguage - varchar(10)
)

I wasn't expecting to get the list of columns in the T_Language table - after all, this is in the SELECT statement, so this really doesn't make a whole lot of sense here.

It almost seems as if SQLPrompt 4 gets confused by the INSERT INTO at the very beginning of the statement, and then thinks I'm about to insert into the T_Language table, which is clearly *NOT* the case.....

Marc
mscheuner
0

Comments

1 comment

  • mscheuner
    Ah, sorry, I guess this is the same problem report by Mike O'Neill on June 3 (under the title of "Table variables" - that's why I didn't see it at first).
    Marc
    mscheuner
    0

Add comment

Please sign in to leave a comment.