Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 18th, 2006, 12:11 AM
Authorized User
 
Join Date: Jul 2006
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default is there anything like array in sqlserver?

hi friends,
i am working on oracle since last 2 years.
we have a project in mssql.
can anybody guide me how can i use array in mssql. is there any other
mechanism available in mssql
thanks in anticipation
Raj
Reply With Quote
  #2 (permalink)  
Old July 18th, 2006, 01:48 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

You can use Table variable or XML for that purpose

Regards
Ganesh
http://ganeshprof.blogspot.com
Reply With Quote
  #3 (permalink)  
Old July 19th, 2006, 12:53 AM
Authorized User
 
Join Date: Jul 2006
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi ganesh,
thanks for ur reply.
here the situation is, i want to store 50 values, and these values will be ultimately inserted into 3-4 various tables depending upon the conditions.
i would like to work specifically on ms sqlserver.
if i use table variable then i have to fire select query for 50 times.
insetead if there is anything which kept the data into my procedure only not in database then it will work for me.
hope this will clear you my point.
waiting for ur reply
thanks once again for that prompt reply


Reply With Quote
  #4 (permalink)  
Old July 19th, 2006, 01:07 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

starnet,

The table variable will not be stored in the database..insted it will be there in your open connection just like all other variables.

The other option is using XML. SQL 2000 goes quite well with XML.

Please feel free to ask furthur questions

Regards
Ganesh
http://ganeshprof.blogspot.com
Reply With Quote
  #5 (permalink)  
Old July 19th, 2006, 07:46 AM
Authorized User
 
Join Date: Jul 2006
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi ganesh,
i read a document on the net, according to which the table variable data as well as global temporary table is created in tempdb database.
but according to you it is not.
if so then why there is a need to fire a select statement to retrive the data from table variable.
here i have a text file from our client. this text file i am inserting into a one column temporary table. I want to write a procedure into sqlserver which will store these varibales value. i have no problem with the logic i.e. how to seperate the row into columns. but the problem is where to store these values.
if i store these values into table variable then i have to write 50 insert statements. is it advisible to use table variable in this case.
i don't want to use XML over here.
please guide me
hope i have clear u
thanks in anticipation
Raj

Reply With Quote
  #6 (permalink)  
Old July 19th, 2006, 08:01 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Raj,

A table variable is always advisible. Because of the well-defined scope, a table variable will generally use fewer resources than a temp table. Transactions touching table variables only last for the duration of the update on the table variable, so there is less locking and logging overhead. So eventhough they are being stored in the database, it looks more like a variable than a temp table.



Regards
Ganesh
http://ganeshprof.blogspot.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convering a String Array to an Integer array nkrust C# 9 November 17th, 2010 12:02 PM
Go from 2d Array to 1d array without defining type OneQuestion General .NET 1 January 10th, 2008 11:13 AM
how to write array in sqlserver msbsam SQL Server 2000 22 October 23rd, 2007 09:00 PM
SQLserver 2000 vs SQLserver 2005 Express cJeffreywang BOOK: Beginning ASP.NET 2.0 and Databases 0 April 22nd, 2007 09:52 AM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM



All times are GMT -4. The time now is 09:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.