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. Global Variables and allways-running-in-background functions

Global Variables and allways-running-in-background functions

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelptutorial
4 Posts 2 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.
  • B Offline
    B Offline
    Blue_Skye
    wrote on last edited by
    #1

    Hi there! Can you help me how to define global variables in MS SQL 2000 or 2005 (@@...) and create a function that auto-start when MS SQL server start. I've searched a lot in google but i still can't found the answer :( Thanks in advance

    F 1 Reply Last reply
    0
    • B Blue_Skye

      Hi there! Can you help me how to define global variables in MS SQL 2000 or 2005 (@@...) and create a function that auto-start when MS SQL server start. I've searched a lot in google but i still can't found the answer :( Thanks in advance

      F Offline
      F Offline
      Farhan Noor Qureshi
      wrote on last edited by
      #2

      I cant say any thing about 2005 but there is no global variable in 2000. Use a status table instead. Farhan Noor Qureshi if (this == this) thow this;

      B 1 Reply Last reply
      0
      • F Farhan Noor Qureshi

        I cant say any thing about 2005 but there is no global variable in 2000. Use a status table instead. Farhan Noor Qureshi if (this == this) thow this;

        B Offline
        B Offline
        Blue_Skye
        wrote on last edited by
        #3

        Hi! Thanks to reply :) The global variables that i want to define are something like @@CONNECTIONS, @@FETCH_STATUS (and anything that begins with @@). Can you help me, please

        F 1 Reply Last reply
        0
        • B Blue_Skye

          Hi! Thanks to reply :) The global variables that i want to define are something like @@CONNECTIONS, @@FETCH_STATUS (and anything that begins with @@). Can you help me, please

          F Offline
          F Offline
          Farhan Noor Qureshi
          wrote on last edited by
          #4

          Like I said, I am not aware of any user defined global variables in SQL 2k. But I suggest a solution. Say, you have a table with two columns, VarName, VarValue that acts as a list of name-value pair. You could write User defined functions that read-write data for each name-value. Here is an example. VarName VarName ------------------- City London Country UK Then you could write UDFs like GetCity(), SetCity(), GetCountry(), SetCountry() etc Farhan Noor Qureshi if (this == this) thow this; -- modified at 13:46 Tuesday 29th November, 2005

          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