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. Can we use Array In SQL Server?

Can we use Array In SQL Server?

Scheduled Pinned Locked Moved Database
databasesql-serversysadmindata-structurestutorial
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.
  • P Offline
    P Offline
    pradipta
    wrote on last edited by
    #1

    Can we use Array In SQL Server ,if yes can any body tell how to use the same. Is it possible to call a stored procedure recursively??? Any answer to the above questions will be highly appreciated

    H 1 Reply Last reply
    0
    • P pradipta

      Can we use Array In SQL Server ,if yes can any body tell how to use the same. Is it possible to call a stored procedure recursively??? Any answer to the above questions will be highly appreciated

      H Offline
      H Offline
      Hesham Amin
      wrote on last edited by
      #2

      Can we use Array In SQL Server ? Yes..but using an indirect way : Create a temporary table like this : CREATE TABLE #temp(Field1 INT PRIMARY KEY) (put the above code in a stored proc or trigger etc..) note the # before the name of the table :#temp this makes the temporary table available for the current connection.. ## will make it available to all connections to free this table use: DROP TABLE #temp Is it possible to call a stored procedure recursively? yes..but by default there is a limited number of nesting levels (31 I think) but you can change it.. hope this can help :)

      P 1 Reply Last reply
      0
      • H Hesham Amin

        Can we use Array In SQL Server ? Yes..but using an indirect way : Create a temporary table like this : CREATE TABLE #temp(Field1 INT PRIMARY KEY) (put the above code in a stored proc or trigger etc..) note the # before the name of the table :#temp this makes the temporary table available for the current connection.. ## will make it available to all connections to free this table use: DROP TABLE #temp Is it possible to call a stored procedure recursively? yes..but by default there is a limited number of nesting levels (31 I think) but you can change it.. hope this can help :)

        P Offline
        P Offline
        pradipta
        wrote on last edited by
        #3

        Thanx for ur valuable suggestions. Can i have a sample stored procedure which is called recursively.

        H 1 Reply Last reply
        0
        • P pradipta

          Thanx for ur valuable suggestions. Can i have a sample stored procedure which is called recursively.

          H Offline
          H Offline
          Hesham Amin
          wrote on last edited by
          #4

          Simply call the same stored proc again in the code: like this: CREATE PROCEDURE MyProc AS . . --your code here . . exec MyProc . . GO the nesting limit is 32 levels (this time i'm sure..got it from MSDN) you can test for the nesting level using :@@NESTLEVEL like : select @@NESTLEVEL AS 'Outer Level'

          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