Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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
 
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
 
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


 
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
 
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

 
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




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





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