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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 insertion with multiple values

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-08-17 : 09:20:57
Hi iam having a table abc

in that fields are name,district,state,
i want to insert into the table as rajasekhar,prakasam,A.P
mahesh,prakasam,A.P
kishore,prakasam,A.P

i want a stored procedure or one function to do so.can anyone help me out in doing such.

in database it can be stored as like that.

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-08-17 : 09:24:29
insert into abc
select 'rajasekhar','prakasam','A.P' union
select 'mahesh','prakasam','A.P' union
select 'kishore','prakasam','A.P'

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-08-17 : 09:30:45
how can i do it in oracle.any idea
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-08-17 : 10:28:19
u can use senthil query in oracle also.
Go to Top of Page
   

- Advertisement -