Search This Blog

Monday, February 11, 2013

System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All members must be provided. (Microsoft.SqlServer.Express.Smo)


Error:
System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All members must be provided. (Microsoft.SqlServer.Express.Smo)


1. When you make the backup, change the Backup Set Name.

2. Remove all of the destinations listed, and add 1 new destination.

3. Do a full backup.

4. Restore this back file .

IN key in sql server query


*****************************************************************************
Ues (in) key for sql query::

select * from formA1

sno
User
id
User
type
year
month
fileno
addno
Computer
no
person
zoneid
regionid
1
1
1
2012     
9
234
345
3
4
1
2
2
3
1
2012     
9
2
4
5
56
1
3
3
1
1
2012     
9
3
3
3
3
1
4
4
4
1
2012     
9
2
3
34
3
1
0
7
3
1
2012     
8
45
3
45
45
1
6
6
3
3
2012     
8
34
34
56
555
2
5


select regionid from formA1 where zoneid=1 and year='2012' and month='9' and usertype='1'

regionid
2
3
4
0

elect SUM(computerno) as totalcomputerno,SUM(fileno) as totalfileno,SUM(person)as totalperson from formA1 where year='2012' and month='9' and usertype='1' and regionid in(select regionid from formA1 where zoneid=1)

totalcomputerno
totalfileno
totalperson
45
241
66

 

Sql query for Unique Output


SELECT * FROM userfORM

userid
usertype
name
branchid
username
1
1
chandra  
12
cp       
2
1
rp       
12
RP       
3
1
RAJ      
13
RAJ      
4
1
KAAL     
14
K        

 SELECT * FROM formA1

sno
userid
usertype
year
month
fileno
addno
computerno
person
1
1
1
2012     
9
234
345
3
4
2
3
1
2012     
9
2
4
5
56
3
1
1
2012     
8
3
3
3
3
4
4
1
2012     
8
2
3
34
3
6
3
1
2012     
8
34
34
56
555

 Select x.branchid from userfORM x inner join formA1 y on x.userid=y.userid where y.userid=x.userid and  y.year='2012' and y.month='9' and y.usertype=1

branchid
12
13

 select * from userFORM where branchid not in (Select x.branchid from userfORM x inner join formA1 y on x.userid=y.userid where y.userid=x.userid and  y.year='2012' and y.month='9' and y.usertype=1)

**********************************OUTPUT*************************************

userid
usertype
name
branchid
username
4
1
KAAL     
14
K