sys table and information_schema view and insert statement

aGoramaGoram Posts: 18
edited August 18, 2009 10:23AM in SQL Prompt Previous Versions
-no suggestion for all the sys table ? or information_schema view ?
it's very usefull ...

- too much line for the insert into.it make the code less readable.
1 line for the column value, 1 line for the commentary (column name - type )is too much
VALUES  (
 ''      
 , -- CODE - varchar(50)
the version in v3 was better :
VALUES ( 
/* CODE - varchar(50) */ '',

Comments

  • Anu DAnu D Posts: 876 Silver 3
    Thanks for your post.

    If I am not getting you wrong following are my suggestions:
    1. no suggestion for all the sys table ? or information_schema view ?

    Could you kindly check your settings: SQL Prompt 4 --> Options --> Suggestions--> Type of suggestions --> select List system objects?

    This should give you suggestion for all system objects. Please let me know if this is not what you are expecting.

    2. - too much line for the insert into.it make the code less readable.

    You can configure the Insert statements as per your requirement.
    Kindly navigate to SQL Prompt 4 --> Options --> Format --> Data Statements. Also configure what you want Insert statement to Insert in your query window navigate to SQL Prompt 4 --> Options --> Inserted Code --> Insert statement.

    Kindly let us know if that helped.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Thanks for the response.
    I found the option i was looking for : Each subsequent column.

    But the thing is : it make the layout i want for the insert into statement but it change the layout of the select statement.

    I mean what a want is this :
    SELECT  staffId
                  , staffName
                  , a
                  , DAY(@dateOnly)
    FROM dbo.personnel
    
    INSERT  INTO mytable(CODE
                                 , NAME
                                 ,ACTIVE
                                 , DESCRIPTION 
                                )
    VALUES  (NULL, -- CODE - nvarchar(50)
             NULL, -- NAME - nvarchar(80)
             '', -- ACTIVE - char(1)
             NULL, -- DESCRIPTION - nvarchar(1500)
             )
    
    
    

    anyway thanks again
  • Anu DAnu D Posts: 876 Silver 3
    Thanks for your post.

    As Insert and Select both are data statements, changes done to the Format Data Statements section will effect both Select and Insert Data Manipulation statements.

    Kindly let us know if you need any help on this.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
Sign In or Register to comment.