Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. function return text

function return text

Scheduled Pinned Locked Moved Database
databasehelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 8453437
    wrote on last edited by
    #1

    hi,i want to create this funcyion but sql not allowed,

    create FUNCTION returnrahgiri(@rahgiri text)
    RETURNS text
    as
    BEGIN
    return (Select response from work_with_us where (response=@rahgiri))
    END

    message error: Msg 2716, Level 16, State 1, Procedure returnrahgiri, Line 1 Column, parameter, or variable #0: Cannot specify a column width on data type text.

    S Richard DeemingR 2 Replies Last reply
    0
    • M Member 8453437

      hi,i want to create this funcyion but sql not allowed,

      create FUNCTION returnrahgiri(@rahgiri text)
      RETURNS text
      as
      BEGIN
      return (Select response from work_with_us where (response=@rahgiri))
      END

      message error: Msg 2716, Level 16, State 1, Procedure returnrahgiri, Line 1 Column, parameter, or variable #0: Cannot specify a column width on data type text.

      S Offline
      S Offline
      susanna floora
      wrote on last edited by
      #2

      You can replace text with Varchar(50) or any specified size.

      1 Reply Last reply
      0
      • M Member 8453437

        hi,i want to create this funcyion but sql not allowed,

        create FUNCTION returnrahgiri(@rahgiri text)
        RETURNS text
        as
        BEGIN
        return (Select response from work_with_us where (response=@rahgiri))
        END

        message error: Msg 2716, Level 16, State 1, Procedure returnrahgiri, Line 1 Column, parameter, or variable #0: Cannot specify a column width on data type text.

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        Assuming you're not using SQL 2000 or earlier, you shouldn't be using the text data-type[^]:

        http://technet.microsoft.com/en-us/library/ms187993.aspx[^]

        ntext , text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups