Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2003
    Posts
    233

    Unanswered: what type of field to use in a table

    i am trying to keep a library of code in sql express. i copied 1 piece of code and tried to past it into the column but it doesnt work, this is a small piece of code, I tried using varchar(4000) for the field and then text but when i paste the code nothing shows in the column and then when i do a select nothing shows, the colm also doesnt allow nulls:


    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    --================================================== ========================
    -- CREATED 3/10/08
    -- Depends on:
    -- DESCRIPTION: Select the TableName, PrimaryKey Columns and the name of the
    -- Primary Key from the table
    --
    --================================================== ========================
    ALTER Proc [On_Impacted_Tables]
    AS
    SELECT B.TABLE_NAME
    , B.COLUMN_NAME
    , B.CONSTRAINT_NAME
    FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS A,
    INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE B,
    TBL_Tables_With_AEGIS_Ref_No_Column C
    WHERE B.Constraint_Name = A.Constraint_Name
    AND B.Table_Name = A.Table_Name
    AND A.Table_Name = C.TableName
    AND Constraint_Type = 'PRIMARY KEY '
    AND c.Impacted =1
    GO

    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER OFF
    GO

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Are you doing the editing through the GUI? I'm not sure how well that would handle pasting into blobs.
    If you are using sqlsvr 2008, use the varchar(max) datatype.
    Also try loading your data with an insert statement rather than pasting into the GUI.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by blindman
    If you are using sqlsvr 2008, use the varchar(max) datatype
    Which is also available on 2005
    George
    Home | Blog

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Sorry. Meant 2005.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Oct 2003
    Posts
    233
    i am using 2000

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Write short, tight code then!
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Max size for VARCHAR is 8k, not 4k BTW.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  8. #8
    Join Date
    Oct 2003
    Posts
    233
    thanks i used an update statement and it was ok

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •