SQLServerÅúÁ¿µ¹ÈëĿ¼Îļþ ÊÕ²Ø
¿ÉÒÔÓÃÀ©Õ¹´æ´¢¹ý³Ìxp_dirtree»ñÈ¡ÎļþÁÐ±í£¬ÓÃopenrowsetµ¹ÈëÊý¾Ýµ½¶þ½øÖÆ×ֶΡ£
openrowsetµÄÓ÷¨¿ÉÒԲο¼msdn
http://technet.microsoft.com/zh-cn/library/ms190312.aspx
Èç¹ûÎļþºÜ¶à£¬½¨Ò黹ÊÇÓóÌÐòµ¹ÈëÁË
if (object_id ('t_bulkResult' ) is not null )
drop table t_bulkResult
create table t_bulkResult (name varchar (1000 ), data image )
go
declare @d varchar (1000 )
set @d = 'c:\test\'
create table #tb (fName varchar (1000 ), d int , f int )
insert into #tb exec xp_dirtree @d , 1 , 1
delete from #tb where f <> 1
declare @ sql nvarchar (max )
select @ sql = isnull (@ sql , '' )+ 'insert into t_bulkResult select ''' +@d + fname + ''',* from openrowset(bulk N''' +@d + fName + ''', SINGLE_BLOB) b
'
from #tb a
exec sp_executesql @ sql
drop table #tb
select * from t_bulkResult
Ïà¹ØÎĵµ£º
1£©Ð½¨Êý¾Ý¿âRESTORE
2£©ÔÚ¸ÃÊý¾Ý¿âÉÏÑ¡Ôñ£ºÈÎÎñ->»¹Ô->Êý¾Ý¿â
3£©ÔÚ»¹ÔÊý¾Ý¿â-RESTOREµÄ¶Ô»°¿òÖÐ
Ä¿±êÊý¾Ý¿âÊÇRESTORE
Ö¸¶¨ÓÃÓÚ»¹ÔµÄ±¸·Ý¼¯µÄÔ´ºÍλÖÃ->Ô´É豸->Ñ¡Ôñ×îºóÒ»¸öÍêÈ«µÄ±¸·ÝBAKÎļþ
¹´Öл¹ÔCheckBox
4£©Ñ¡Ôñ×óÉϽǵÄÑ¡Ïî
ÔÚ»¹ÔÑ ......
SQLÓï¾äÈçÏÂ:
CREATE TABLE [dbo].[test_table] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[NAME] [varchar] (80)
)
Éè¼ÆÊÓͼÏÂ,ÔÚÌí¼ÓÒ»¸öINTÐ͵Ä×Ö¶ÎÊÇ,Ñ¡ÖÐÏ·½µÄ"±êʶ"Ϊ"ÊÇ",ÏÂÃæÓÐ"±êʶÖÖ×Ó"ºÍ"±êʶ×ÔÔöÁ¿",¿ÉÒÔ×Ô¼ºÉèÖÃ,ĬÈ϶¼Îª1
µ«ÊDz»ÖªµÀΪʲô,ʹÓÃÈÎÎ ......
±¾ÆªÄÚÈÝϵÊôSQLServer¸ß¼¶±à³Ì£¬ÊÊÓÃÓÚÓûÌá¸ß×Ô¼ººÍ¸´Ï°»òÓ¦¸¶ÃæÊÔµÄÅóÓÑÔĶÁ£¬Í¬Ê±±¾ÈËѧϰ²»¾Ã£¬ÔÚ×ܽáºÍ¹éÄÉʱ´íÎóºÍ²»Ç¡µ±Ö®´¦ÔÚËùÄÑÃ⣬»¹ÇëÖ¸³öÆäÖБ¶ËÄß’£¬ÓèÒÔÍêÉÆ¡£
±í1:Users
USE [Wish]
GO
/****** ¶ÔÏó: Table [dbo].[Users] ½Å±¾ÈÕÆÚ: ......
//ÕâÊÇÌí¼Ó
private void button1_Click(object sender, EventArgs e)
{
string s = "Persist Security Info=False;Integrated Security=SSPI;database=IIntegration;server=(local)";
&n ......
SQL Server 2008 Administration Instant Reference
SQL Server 2005 Êý¾Ý¿â»ù´¡ÓëÓ¦Óü¼Êõ
Microsoft SQLServer 2005 Integration Services Step by Step
SQLServer 2005 Bible
SQL Server 2005 Êý¾Ý¿â·þÎñ¼Ü¹¹Éè ......