Learning Home: SQL SERVER

Wednesday, 26 April 2017

SQL SERVER


 

Select multiple rows without loop in SQL SERVER

declare @t varchar(max)
set @t = 'Product :'
select @t = @t + ',' + ItemInfo.ItemName from ItemInfo
print @t

SQL SERVER database suspect problem solution.



EXEC sp_resetstatus BeaconAcc;
ALTER DATABASE BeaconAcc SET EMERGENCY
DBCC checkdb(BeaconAcc)
ALTER DATABASE BeaconAcc SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (BeaconAcc, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE BeaconAcc SET MULTI_USER



Note: BeaconAcc is DBName.

No comments:

Post a Comment