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. Assign Value to Parameter

Assign Value to Parameter

Scheduled Pinned Locked Moved Database
questionlearning
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.
  • J Offline
    J Offline
    JrunkDunc
    wrote on last edited by
    #1

    Hey, So I am trying to get the Highest MenuOrder Value there is increment that by one and then use that value to insert a new object in with the next highest menu order My attempt so far is as so: Declare @MenuSeed as int Select @MenuSeed = Top(1) MenuOrder From Pages Order By MenuOrder DESC And of course that doesn't work, but I am kinda lost on what to do here, can anyone shed some light? Thanks Alot -Seth

    B L 2 Replies Last reply
    0
    • J JrunkDunc

      Hey, So I am trying to get the Highest MenuOrder Value there is increment that by one and then use that value to insert a new object in with the next highest menu order My attempt so far is as so: Declare @MenuSeed as int Select @MenuSeed = Top(1) MenuOrder From Pages Order By MenuOrder DESC And of course that doesn't work, but I am kinda lost on what to do here, can anyone shed some light? Thanks Alot -Seth

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      Declare @MenuSeed as int Set @MenuSeed = (select max(MenuOrder) From PagesOrder)


      I Love T-SQL "Don't torture yourself,let the life to do it for you."

      1 Reply Last reply
      0
      • J JrunkDunc

        Hey, So I am trying to get the Highest MenuOrder Value there is increment that by one and then use that value to insert a new object in with the next highest menu order My attempt so far is as so: Declare @MenuSeed as int Select @MenuSeed = Top(1) MenuOrder From Pages Order By MenuOrder DESC And of course that doesn't work, but I am kinda lost on what to do here, can anyone shed some light? Thanks Alot -Seth

        L Offline
        L Offline
        leoinfo
        wrote on last edited by
        #3

        SET @MenuSeed = (Select Top 1 MenuOrder From Pages Order By MenuOrder DESC )

        OR

        Select Top 1 @MenuSeed = MenuOrder From Pages Order By MenuOrder DESC

        Please... SAVE my time by rating the posts that you read!


        There are 10 kinds of people in the world: those who understand binary and those who don't.

        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