Citrix Director issue related to MSSQL

Hi MS SQL and Citrix Experts

i have the issue in this URL

https://support.citrix.com/article/CTX208206

but the solution inside this URL dose not work with me

please check the attached file

how can i remove the  nul   0000000000000000000000000  in my case

kindly advice
ddddddd.jpg
LVL 1
sword12Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_agx_Commented:
The error message says it cannot delete the uuid from "DesktopGroup" because it's still being referenced by 1 or more records in "Machine" table.  Did you run all of the DELETE's - in order?  

Run a select on that uuid.  What result to you get?

declare @did uniqueidentifier
set @did = '00000000-0000-0000-0000-000000000000'
select * from MonitorData.Machine where DesktopGroupId = @did
select * from MonitorData.DesktopGroup where id = @did
0
sword12Author Commented:
thnaks for help

please check the attached file

and if you can give me the all commands that i have to issue one after one
dd2.jpg
0
sword12Author Commented:
can you give the solution one by one

i have no idea about data base administration

declare @did uniqueidentifier
set @did = '00000000-0000-0000-0000-000000000000'
delete from MonitorData.Session where machineid in (Select Id from MonitorData.Machine where DesktopGroupID = @did)
delete from MonitorData.ResourceUtilizationSummary where DesktopGroupId = @did
delete from MonitorData.ResourceUtilization where DesktopGroupId = @did
delete from MonitorData.ApplicationInstanceSummary where DesktopGroupId = @did
delete from MonitorData.DesktopGroupApplications where DesktopGroupId = @did
delete from MonitorData.SessionActivitySummary where DesktopGroupId = @did
delete from MonitorData.FailureLogSummary where DesktopGroupId = @did
delete from MonitorData.ServerOSDesktopSummary where DesktopGroupId = @did
delete from MonitorData.DesktopOSDesktopSummary where DesktopGroupId = @did
delete from MonitorData.Machine where DesktopGroupId = @did
delete from MonitorData.DesktopGroup where id = @did
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

John_VidmarCommented:
You were in the wrong database when you executed the above commands.  

Your attachment (dd2.jpg) showed the first select worked because it used 3-part qualification (database.owner.object) with the correct database, your second statement produced an error because you are in the wrong database.
1
sword12Author Commented:
U r right

But in this url

https://support.citrix.com/article/CTX208206

I have to work with monitoring data base

Desk group dB not machine dB

So what I have to do now
0
John_VidmarCommented:
Add use-database above the statements from Citrix (hopefully I spelled it correctly):
use [CitrixLentingmonitoring]
go
declare @did uniqueidentifier 
set @did = '00000000-0000-0000-0000-000000000000' 
delete from MonitorData.Session where machineid in (Select Id from MonitorData.Machine where DesktopGroupID = @did) 
delete from MonitorData.ResourceUtilizationSummary where DesktopGroupId = @did 
delete from MonitorData.ResourceUtilization where DesktopGroupId = @did 
delete from MonitorData.ApplicationInstanceSummary where DesktopGroupId = @did 
delete from MonitorData.DesktopGroupApplications where DesktopGroupId = @did 
delete from MonitorData.SessionActivitySummary where DesktopGroupId = @did 
delete from MonitorData.FailureLogSummary where DesktopGroupId = @did 
delete from MonitorData.ServerOSDesktopSummary where DesktopGroupId = @did 
delete from MonitorData.DesktopOSDesktopSummary where DesktopGroupId = @did 
delete from MonitorData.Machine where DesktopGroupId = @did 
delete from MonitorData.DesktopGroup where id = @did

Open in new window

1
_agx_Commented:
@sword12 - All of the tables in the script are in the same database.  You need to switch to that database first. John_Vidmar's answer shows how to do that with:  USE yourdatabaseNameHere
0
sword12Author Commented:
thnak you all for help but i am still stuck with this

delete from MonitorData.Session where machineid in (Select Id from MonitorData.Machine where DesktopGroupID = @did)

i don't understand what dose it mean (Select Id from MonitorData.Machine where DesktopGroupID = @did)

option one i isued this and i got error check the attached file
use [CitrixLentingmonitoring]
go
declare @did uniqueidentifier
set @did = '00000000-0000-0000-0000-000000000000'
delete from MonitorData.ResourceUtilizationSummary where DesktopGroupId = @did
delete from MonitorData.ResourceUtilization where DesktopGroupId = @did
delete from MonitorData.ApplicationInstanceSummary where DesktopGroupId = @did
delete from MonitorData.DesktopGroupApplications where DesktopGroupId = @did
delete from MonitorData.SessionActivitySummary where DesktopGroupId = @did
delete from MonitorData.FailureLogSummary where DesktopGroupId = @did
delete from MonitorData.ServerOSDesktopSummary where DesktopGroupId = @did
delete from MonitorData.DesktopOSDesktopSummary where DesktopGroupId = @did
delete from MonitorData.Machine where DesktopGroupId = @did
delete from MonitorData.DesktopGroup where id = @did


option two i issued this and still no result

use [CitrixLentingmonitoring]
go
declare @did uniqueidentifier
set @did = '00000000-0000-0000-0000-000000000000'
delete from MonitorData.Session where machineId = @did
delete from MonitorData.ResourceUtilizationSummary where DesktopGroupId = @did
delete from MonitorData.ResourceUtilization where DesktopGroupId = @did
delete from MonitorData.ApplicationInstanceSummary where DesktopGroupId = @did
delete from MonitorData.DesktopGroupApplications where DesktopGroupId = @did
delete from MonitorData.SessionActivitySummary where DesktopGroupId = @did
delete from MonitorData.FailureLogSummary where DesktopGroupId = @did
delete from MonitorData.ServerOSDesktopSummary where DesktopGroupId = @did
delete from MonitorData.DesktopOSDesktopSummary where DesktopGroupId = @did
delete from MonitorData.Machine where DesktopGroupId = @did
delete from MonitorData.DesktopGroup where id = @did


so how i can pass this issue please
dd3.jpg
0
John_VidmarCommented:
The order in which Citrix presented the delete-statements is important, otherwise, you shall receive referential-integrity errors (i.e., the constraint messages you get in red-text).
I'll explain the following:
delete	MonitorData.Session
where	machineid in	(	Select Id
					from MonitorData.Machine
					where DesktopGroupID = @did
				)

Open in new window

The select-statement wrapped in parenthesis is called a subquery, which shall return zero, one, or many records.  A subquery participating in an in-clause may only contain a single field in the select.  Assume the subquery returns three records (11, 83, 492), this is then used in the delete where-clause to further restrict which records are deleted.  Behind the scenes, the following would be equivalent:
delete	MonitorData.Session
where	machineid in (11, 83, 492)

Open in new window

Don't alter the statements from Citrix, just ensure you are in the correct database by adding the use-database and go
use [CitrixLentingMonitoring]
go
declare @did uniqueidentifier 
set @did = '00000000-0000-0000-0000-000000000000' 
delete from MonitorData.Session where machineid in (Select Id from MonitorData.Machine where DesktopGroupID = @did) 
delete from MonitorData.ResourceUtilizationSummary where DesktopGroupId = @did 
delete from MonitorData.ResourceUtilization where DesktopGroupId = @did 
delete from MonitorData.ApplicationInstanceSummary where DesktopGroupId = @did 
delete from MonitorData.DesktopGroupApplications where DesktopGroupId = @did 
delete from MonitorData.SessionActivitySummary where DesktopGroupId = @did 
delete from MonitorData.FailureLogSummary where DesktopGroupId = @did 
delete from MonitorData.ServerOSDesktopSummary where DesktopGroupId = @did 
delete from MonitorData.DesktopOSDesktopSummary where DesktopGroupId = @did 
delete from MonitorData.Machine where DesktopGroupId = @did 
delete from MonitorData.DesktopGroup where id = @did

Open in new window

1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Citrix

From novice to tech pro — start learning today.