Click here to Skip to main content
15,897,371 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: linkbutton query string Pin
sashidhar11-Oct-09 21:52
sashidhar11-Oct-09 21:52 
Question[Message Deleted] Pin
bhavnvyas11-Oct-09 20:46
bhavnvyas11-Oct-09 20:46 
AnswerRe: Hi all Pin
Abhijit Jana11-Oct-09 21:03
professionalAbhijit Jana11-Oct-09 21:03 
Questiongetting ID of inserted record Pin
uglyeyes11-Oct-09 20:10
uglyeyes11-Oct-09 20:10 
QuestionDll method is not making a connection with the host server. Pin
shrish garg11-Oct-09 20:05
shrish garg11-Oct-09 20:05 
Questioninsert thousand records on single click Pin
sjs4u11-Oct-09 19:37
sjs4u11-Oct-09 19:37 
AnswerRe: insert thousand records on single click Pin
dan!sh 11-Oct-09 19:48
professional dan!sh 11-Oct-09 19:48 
AnswerRe: insert thousand records on single click [modified] Pin
bhavnvyas11-Oct-09 21:49
bhavnvyas11-Oct-09 21:49 
USE [iLOS]
GO
[dbo].[sp_InsertData] Script Date: SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_InsertData]
(@xmlString VARCHAR(MAX))
AS
BEGIN
/* Initialize a handle for the XmlDocument */ 
DECLARE @xmlHandle INT 
/* 
Create a table variable to store the extract XmlData into Relational 
Database Format. Unlike temporary tables, Table variables are 
automatically removed from memory by SQL Server when the procedure 
has completed. So, there is no need to try and drop them at the 
end of the procedure. 
*/ 
DECLARE @stagingTable TABLE 
( 
[Name] VARCHAR(50), 
[Address] VARCHAR(50), 
[Phone] VARCHAR(50)
) 
/* 
Create the XmlDocument using the handle above and the Xml 
string as parameters. If your stored procedure has an varchar input 
parameter named @xmlString, it would look like this instead: 
EXEC sp_xml_preparedocument @xmlHandle output,@xmlString 
*/ 
EXEC sp_xml_preparedocument @xmlHandle output, @xmlString 
/* 
Use the OPENXML method to query the XmlDocument starting at 
/NewDataSet/SampleDataTable node.
*/ 
INSERT INTO @stagingTable 
SELECT [Name] ,
[Address],
[Phone] 
FROM OPENXML (@xmlHandle, '/NewDataSet/SampleDataTable',1) 
WITH ([Name] varchar(50) '@Name', 
[Address] varchar(50) '@Address', 
[Phone] varchar(50) '@Phone'
)

/*Insert the records into the table variable turning the XML structured 
data into relational data. We are now free to query the table variable 
just as if it were a regular table for use with data manipulation, cursors, etc... 
It could also be used for generated reports and counts in ways that might 
be simpler to code in SQL Server vs XSL.*/ 
INSERT INTO SampleData ([Name], 
[Address], 
[Phone]) 
(SELECT [Name] ,
[Address],
[Phone]
FROM @stagingTable)


/* Remove the document from memory */ 
EXEC sp_xml_removedocument @xmlHandle
END


hi first insert all records in som xml file and thn use above sp i think it might work in your case..

modified on Monday, October 12, 2009 4:38 AM

GeneralRe: insert thousand records on single click Pin
sashidhar11-Oct-09 22:01
sashidhar11-Oct-09 22:01 
QuestionGet the moving mouse position Pin
lbs.allies11-Oct-09 18:58
lbs.allies11-Oct-09 18:58 
AnswerRe: Get the moving mouse position Pin
dan!sh 11-Oct-09 19:37
professional dan!sh 11-Oct-09 19:37 
AnswerRe: Get the moving mouse position Pin
Abhijit Jana11-Oct-09 19:37
professionalAbhijit Jana11-Oct-09 19:37 
QuestionIn a literal control How i should embed a Html coding/Page? Pin
sharmilajv11-Oct-09 18:23
sharmilajv11-Oct-09 18:23 
AnswerRe: In a literal control How i should embed a Html coding/Page? Pin
sashidhar11-Oct-09 19:07
sashidhar11-Oct-09 19:07 
GeneralRe: In a literal control How i should embed a Html coding/Page? Pin
sharmilajv11-Oct-09 19:23
sharmilajv11-Oct-09 19:23 
GeneralRe: In a literal control How i should embed a Html coding/Page? Pin
sashidhar11-Oct-09 19:37
sashidhar11-Oct-09 19:37 
GeneralSending Mail Pin
sharmilajv11-Oct-09 21:05
sharmilajv11-Oct-09 21:05 
GeneralRe: Sending Mail Pin
sashidhar11-Oct-09 21:57
sashidhar11-Oct-09 21:57 
QuestionSql Time out Error Pin
ksss_maheshece11-Oct-09 18:09
ksss_maheshece11-Oct-09 18:09 
AnswerRe: Sql Time out Error Pin
Abhijit Jana11-Oct-09 18:12
professionalAbhijit Jana11-Oct-09 18:12 
GeneralRe: Sql Time out Error Pin
nagendrathecoder11-Oct-09 18:52
nagendrathecoder11-Oct-09 18:52 
GeneralRe: Sql Time out Error Pin
Abhijit Jana11-Oct-09 19:34
professionalAbhijit Jana11-Oct-09 19:34 
GeneralRe: Sql Time out Error Pin
ksss_maheshece11-Oct-09 20:13
ksss_maheshece11-Oct-09 20:13 
GeneralRe: Sql Time out Error Pin
ksss_maheshece11-Oct-09 19:22
ksss_maheshece11-Oct-09 19:22 
AnswerRe: Sql Time out Error Pin
sashidhar11-Oct-09 18:51
sashidhar11-Oct-09 18:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.