借助GUI在SQL Server 2008中的表中添加记录 [英] Add records in a table in SQL Server 2008 with the help of GUI

查看:131
本文介绍了借助GUI在SQL Server 2008中的表中添加记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含10列的表,现在我需要在该表中插入100条记录.还有其他方法可以轻松地添加记录,而无需编写插入语句100次.

请告诉我解决方案.........

I have a table that contains 10 Columns, now i need to insert 100 records in that table. Is there any other way to add records easily without writing insert statement 100 times.

Please tell me the solution.........

推荐答案



您可以为此编写程序.

Hi,

you can write procedure for this purpose.

create proc dbo.insertdata        
(        
	@inputXml xml       
	    
)        
AS        
BEGIN 
select * into #temp
	from openxml(@InputXMLHandle,''/Data'')        
	with        
	(        
		columnname datatype,        
		columnname datatype,
		columnname datatype,
		columnname datatype,
		columnname datatype,
	)   
	
	
	
	 insert into tablename 
	select * from #temp
	
	
	drop #temp

end



希望对您有帮助....



hope this will help you....


在excel文件中输入数据.复制并粘贴.或者您可以上传它.
Input your data in excel file. Have it copy then paste. Or you can upload it.


这篇关于借助GUI在SQL Server 2008中的表中添加记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆