Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Insert statement with reference

Author  Topic 

pradeepmanne
Starting Member

31 Posts

Posted - 2011-12-26 : 10:35:20
hi,
i want to insert the values into a database table from frontend
by ref
can we use inseert statement with ref????

thanks inadvance

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-26 : 11:11:07
what do you mean by ref?
you can use parameters to pass on values to insert.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

pradeepmanne
Starting Member

31 Posts

Posted - 2011-12-26 : 11:13:46
quote:
Originally posted by visakh16

what do you mean by ref?
you can use parameters to pass on values to insert.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/




Ref means byreference inserting array index values by insert statement
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-26 : 11:23:03
ok...that what you're using parameters for

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

pradeepmanne
Starting Member

31 Posts

Posted - 2011-12-26 : 11:28:23
i want to insert ref values into table
and the array is dynamic and size of array is created at runtime
i nedd a statement to insert statement for array which is created at runtime datatype is same for all columns
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-12-26 : 11:35:33
There is no native data type in SQL that supports an array parameter for a stored procedure - you can use user-defined array types in SQL 2008. There are other ways as well - packing up the data as an XML fragment and sending to the database and shredding it in T-SQL etc.

There is a discussion of various options at Sommarskog's blog here: http://www.sommarskog.se/arrays-in-sql.html
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-12-26 : 11:38:27
don't use sql server

do you know what a relational model is?


"IF everything looks like a nail..."


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-26 : 11:39:22
quote:
Originally posted by pradeepmanne

i want to insert ref values into table
and the array is dynamic and size of array is created at runtime
i nedd a statement to insert statement for array which is created at runtime datatype is same for all columns



see an example here

http://visakhm.blogspot.com/2010/04/using-xml-to-batch-load-master-child.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -