Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: query problem

  1. #1
    Join Date
    Jun 2007
    Posts
    197

    Smile Unanswered: query problem

    please help me solve the problem in query
    following is the query

    CREATE TABLE [ISMMDM] (
    [MDMRFNUM] [BIGINT] NOT NULL IDENTITY (1, 1) NOT NULL ,
    [NAME] [NVARCHAR] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [CONTENT] [VARCHAR] (10000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [TDMRFNUM] [BIGINT] NULL ,
    [SUBJECT] [NVARCHAR] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [FROM] [NVARCHAR] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [TO] [NVARCHAR] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [TOQDMRFNUM] [BIGINT] NULL ,
    [CC] [NVARCHAR] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [CCQDMRFNUM] [BIGINT] NULL ,
    [BCC] [NVARCHAR] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [BCCQDMRFNUM] [BIGINT] NULL ,
    [LOG] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [CREATEDATE] [datetime] NULL,
    [MODIDATE] [datetime] NULL,
    [FLDSTR1] [NVARCHAR] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [FLDSTR2] [NVARCHAR] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [FLDSTR3] [NVARCHAR] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [DELETED] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL WITH DEFAULT 'N',
    [CREATEDBY] [BIGINT] NOT NULL WITH DEFAULT 0,
    CONSTRAINT [PK_ISMMDM] PRIMARY KEY CLUSTERED
    (
    [MDMRFNUM]
    ) ON [PRIMARY]
    ) ON [PRIMARY]


    what changes should I do
    Attached Thumbnails Attached Thumbnails SQL2.jpg  
    Last edited by ankur02018; 07-04-07 at 12:03.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    The error messages are clues

    10000 is too big for the datatype and there is no "With" when defining a default value.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jun 2007
    Posts
    197

    Smile

    I dont want alter 10000 so which data type I should use and how

    so what would be the correct syntax for this query

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    instead of VARCHAR(10000) which is too big, use TEXT (with no number in parentheses after it)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Or, if you are using SQL Server 2005, VARCHAR(MAX).
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    it looks like you are using 2005 since you are using SSMS. in that case use varchar(max) as pootle suggests. text, ntext, image are deprecated in 2005.

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Call me Mr Picky if you like but also.... that ain't a query
    Testimonial:
    pootle flump
    ur codings are working excelent.

  8. #8
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by jezemine
    it looks like you are using 2005 since you are using SSMS.
    Good spot. One of us is paying attention to the picture clues then
    Testimonial:
    pootle flump
    ur codings are working excelent.

  9. #9
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by jezemine
    text, ntext, image are deprecated in 2005.
    ta very much

    didn't know that

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  10. #10
    Join Date
    Jun 2007
    Posts
    197

    Smile

    My problem is solved Thanks to you all for giving suggestion

    BUT I heard that using TEXT data type decreases performance so can we
    use VARCHAR(MAX) upto how much character it stores and what is the synatax
    Last edited by ankur02018; 07-05-07 at 00:51.

  11. #11
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    varchar(max) has the same size limitation as TEXT. 2gb worth of text as I recall.

    just to be clear: do not use TEXT. use nvarchar(max) - text suffers from certain limitations that nvarchar(max) does not.

  12. #12
    Join Date
    Jun 2007
    Posts
    197

    Smile

    can any one tell the correct syntax for using VARCHAR(MAX)
    with example

    name VARCHAR(MAX) (10000) not working how we use

  13. #13
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    drop the (10000).
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  14. #14
    Join Date
    Jun 2007
    Posts
    197

    Smile

    Quote Originally Posted by Thrasymachus
    drop the (10000).
    i have to 10000 with VARCHAR (MAX) but how ???

  15. #15
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    how? by leaving it out
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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