Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 06, 2012 06:16 AM by nilsan
Member
47 Points
74 Posts
Jan 06, 2012 04:16 AM|LINK
Hi,
I have one variable Like @EventId, i get value form codebehined Like{1,2,3} and committeeId {8} , UserId {84544}
i Want to insert table EVENT in this eventid,committeeId,UserId colums are there,
EventId CommitteeId UserId
1 8 84544
2 8 84544
3 8 84544
Like this i want to insert , send me query useing cursor and anything
306 Points
97 Posts
Jan 06, 2012 04:19 AM|LINK
Hello,
Query is
insert into event (EventId,committeid,userid) values (1,2,3)
Jan 06, 2012 06:10 AM|LINK
HI,
What about committeeId,UserId,
ur's query output is
eventid 1
committeeId 2
UserId 3
Like, but i want to above mestion like that
All-Star
17540 Points
3825 Posts
Jan 06, 2012 06:16 AM|LINK
Use split function mentioned here
Then use query something like below.
Insert into Event(eventid,commentid,userid) select data,@commentid,@Userid from dbo.split(@eventid,',')
goud2010
Member
47 Points
74 Posts
Insert Details in Table
Jan 06, 2012 04:16 AM|LINK
Hi,
I have one variable Like @EventId, i get value form codebehined Like{1,2,3} and committeeId {8} , UserId {84544}
i Want to insert table EVENT in this eventid,committeeId,UserId colums are there,
EventId CommitteeId UserId
1 8 84544
2 8 84544
3 8 84544
Like this i want to insert , send me query useing cursor and anything
Venkat Goud.
jennyortem
Member
306 Points
97 Posts
Re: Insert Details in Table
Jan 06, 2012 04:19 AM|LINK
Hello,
Query is
insert into event (EventId,committeid,userid) values (1,2,3)
goud2010
Member
47 Points
74 Posts
Re: Insert Details in Table
Jan 06, 2012 06:10 AM|LINK
HI,
What about committeeId,UserId,
ur's query output is
eventid 1
committeeId 2
UserId 3
Like, but i want to above mestion like that
Venkat Goud.
nilsan
All-Star
17540 Points
3825 Posts
Re: Insert Details in Table
Jan 06, 2012 06:16 AM|LINK
Use split function mentioned here
Then use query something like below.
Blog | Get your forum question answered | Microsoft Community Contributor 2011