SQL query to list the "Administrative category" field for all applications
yesterday i started a thread to list the "Optional reference" field for all cm applications in a SSRS report. I've got the query with the help of Torsten.
https://social.technet.microsoft.com/Forums/en-US/00419e6e-e3c2-4b80-b6af-2a24ced1032d/sql-query-to-list-the-optional-reference-field-of-all-packages-in-cm-2012?forum=configmanagersdk
But again today, i'm looking for a way to get "Administrative category" field in a SSRS report. Could someone point me to the right direction ?
Kindly mark as answer/Vote as helpful if a reply from anybody helped you in this forum. Delphin
Hi,
You could monitor the SMSProv.log when you check the category of an application. It shows that SQL query the SCCM provider used is related to function fn_ListCategoryInstances.
Best Regards,
Joyce
Similar Messages
-
SQL Query to list the "Optional reference" field of all packages in cm 2012
Guys, could you please point me to the correct view to extract the "Optional reference" property of all application? I've got a powershell script to get that from WMI, but i really am expecting a way to extract it from ConfigMgr DB if that's
available in CM Db.
Thanks,
Delphin.
Kindly mark as answer/Vote as helpful if a reply from anybody helped you in this forum. DelphinThank you torsten for helping me out here.
I've managed to come up with a query to list the Display name, package verison and optional reference property.
;WITH XMLNAMESPACES ( DEFAULT 'http://schemas.microsoft.com/SystemCenterConfigurationManager/2009/AppMgmtDigest')
select DisplayName, SDMPackageDigest.value('(/AppMgmtDigest/Application/CustomId/@ResourceId)[1]', 'nvarchar(10)') [Optional Reference]
,sdmpackageversion
from fn_ListApplicationCIs(1033)
order by DisplayName
But the problem here is, I'm looking for the value AB00001 from that XML but it actually giving me Res_631986121. Can someone help me to get the value AB00001 from that xml file?
<CustomId ResourceId="Res_631986121">AB00001</CustomId>
Kindly mark as answer/Vote as helpful if a reply from anybody helped you in this forum. Delphin -
SQL query to fetch the catalog category for a PLM item
Hi All,
Can anyone help me with a sql query of how we can fetch the catalog category for a PLM item.
Regards,
ShrutiHi,
You could monitor the SMSProv.log when you check the category of an application. It shows that SQL query the SCCM provider used is related to function fn_ListCategoryInstances.
Best Regards,
Joyce -
SQL query to get the without SCCM agent for a Server
Hello every one,
Can I get the SQL query for a server without a SCCM agent .Here you go!!
Add the version for windows 2012 server if you have them as well in your environment
v_R_System.Netbios_Name0
,v_R_System.Full_Domain_Name0
,v_R_System.User_Name0
,case
When v_R_System.Operating_System_Name_and0 LIKE N'%Server 6.1'THEN 'Windows Server 2008 R2'
When v_R_System.Operating_System_Name_and0 LIKE N'%Server 6.0'THEN 'Windows Server 2008'
When v_R_System.Operating_System_Name_and0 LIKE N'%Server 5.2'THEN 'Windows Server 2003 R2'
ELSE 'Unknown Version' END AS 'OS version'
FROM
v_R_System
WHERE
v_R_System.Operating_System_Name_and0 LIKE N'%server%' and v_R_System.Client0 is null
Kindly mark as answer/Vote as helpful if a reply from anybody helped you in this forum. Delphin -
SQL Query to get the # of files in folders in a library
Anyone has the SQL query to list the number of files in each folders in a SharePoint library?
Technically it's a grey area of support as MS don't mind you doing it but won't help you if you encounter problems, the script is much better though.
Scratch that, the script isn't that good. It's using .items which won't work on large lists and is slow. The version below is untested but should be significantly faster and work on large lists.
$starttime = Get-Date
#Creating new site object
$siteurl = Read-Host "Enter the name of your site and press enter"
$site = New-Object Microsoft.SharePoint.SPSite($siteurl)
#Assigning all webs (sites) to $webs
$webs = $site.Allwebs
#System Libraries defined so they won't be touched##
$systemlibs =@("Converted Forms", "Customized Reports", "Documents", "Form Templates",
"Images", "List Template Gallery", "Master Page Gallery", "Pages",
"Reporting Templates", "Site Assets", "Site Collection Documents",
"Site Collection Images", "Site Pages", "Solution Gallery",
"Style Library", "Theme Gallery", "Web Part Gallery", "wfpub")
Write-Host "Total number of webs that will be traversed: " $webs.count
$DocLibsCount = 0
$DocLibwItems = 0
$totalitems = 0
$subfolderitems = 0
foreach($web in $webs)
$listcoll = $web.lists
foreach($list in $listcoll)
if($list -eq $null)
Write-Host
else
$base = $list.GetType()
if($base.name -eq "SPDocumentLibrary")
if ($systemlibs -contains $list)
{ continue}
else
$DocLibsCount += 1
$totalitems += $List.itemcount
$name = $list.Title
$folders = $web.GetFolder($name).SubFolders
for($etr = 0;$etr -lt $folders.count; $etr++)
if($folders[$etr].Name -ne "Forms")
Write-Host "Processing SubFolder ItemCount" -ForegroundColor Red
$tempcount = $folders[$etr].ItemCount
$subfolderitems += $tempcount
Write-Host
Write-Host
Write-Host "Total # of Document Libraries: " $DocLibsCount -ForegroundColor Green
Write-Host "Total # of Document Libraries that contain items: " $DocLibwItems -ForegroundColor Green
Write-Host "Total # of items: " $totalitems -ForegroundColor Green
Write-Host "Total # of items in DocLib\Subfolders: " $subfolderitems -ForegroundColor Green
$finishtime = Get-Date
Write-Host
Write-Host “Script Duration” –ForegroundColor Yellow
Write-Host “Started: “ $starttime –ForegroundColor Yellow
Write-Host “Finished: “ $finishtime –ForegroundColor Yellow
Stop-SPAssignment -Global -
Display the auto forward address for all users
Is there a transaction I can execute in ERP that will display the Auto Forward address for all users? I know that SO36 can be used to create an auto forward address for an individual user, however, I would like to list the auto forward address for all users
According to the 2nd article - I've created an empty Company_Phone_Number_Normalization_Rules.txt file and placed it in the Lync file share, in order to avoid any suspicion that the built-in file might be used. I've updated the address book but unfortunately
can't restart the FE services at this time. There's no still no change in the client.
Yet - the problem here is the numbers shown aren't present in the files making up the Lync address book inside the local user's sip profile folder. -
SQL query to get the list of approvals
Hi,
Could someone let me know the SQL query to get the list of all the pending approvals for a user in OIM 11g R2.
ThanksThere are a few ways to do this:
- The easiest would be to use a Relationship Query from the CMC. To do this, go to the Universes section on the CMC, right click on the relevant universe, select tools >> Check Relationships.
- Use Query Builder. You will need more than one query to pull the information you need. You could try something like the below (for Webi)
SELECT SI_NAME, SI_WEBI, SI_DATACONNECTION FROM CI_APPOBJECTS
WHERE SI_KIND = 'universe' and SI_NAME = 'Universe Name'
This will give you a list of Webi Reports by SI_ID.
You'll need another query to list Webi report names:
SELECT SI_NAME FROM CI_INFOOBJECTS WHERE SI_ID IN (SI_ID from query above)
- This is trivial via Auditing / the Activity universe. This of course will only return reports that have already run.
Best.
Srinivas -
SQL Query To Select The 5th Element
In the report I am currently working on, I am using an Add Command custom SQL query to pull the data that I need. The structure is a Call and a list of associated Activities. In this particular scenario, there are 8 activity notes for a type of call and I want to return the 5th one. The activity notes are a specific sequence of captured actions and I need the note from the 5th step in the sequence.
This is what I have come up with:
SELECT CALL.call_id,
(select top 1 from (select top 5 CONVERT(char(8000),ACTIVITY.activity_note) from ACTIVITY
where CALL.call_id = ACTIVITY.call_id
order by ACTIVITY.creat_date desc))
as activity_tx
FROM CALL
The intent of the Top 5 was to get the first 5 activity notes, of which the 5th note would be the last, then reverse sort them so I could take the Top 1 (which would be the 5th of 8). But I am getting a vague syntax error between "from" and "order by". Any suggestions would be appreciated.
Thanks!
Fuskie
Who thought he had a solution but is flummoxed he can't bring it home...Hello,
Let me explain that Crystal assumes the user knows how to write SQL. We only report on the data provided by the SQL you write.
I did a quick search using Microsofts new search engine - www.bing.com and it returned this as well as lots more:
http://forums.devshed.com/php-development-5/how-to-access-a-certain-element-in-the-results-of-606217.html
Try searching in MSSQL's site also for more info on how to get the results you are looking for.
Thank you
Don -
Sql query to list menus, submenus and function-names for all resp
Hi,
Please let me know one single sql query to list all the menus, submenus and user-function-names attached for all responsibilities
Thanks...Hi,
See the following threads.
How to find All The Responsibilities with a specific Menu
How to find All The Responsibilities with a specific Menu
SQL query
SQL query
Regards,
Hussein -
PLEASE SEND ME SQL query to list ALL CONSTRAINTS ON EMPLOYEES TABLE FROM OU
PLEASE SEND ME SQL query to list ALL CONSTRAINTS ON EMPLOYEES TABLE FROM OUTSIDE PP SCHEMA INCLUDING SCHEMA NAME AND CONSTraint NAME
Username : PP
Table : EmployeesI think you are looking for below query :
SQL> SHOW USER;
USER is "SCOTT"
SQL> select owner,constraint_name,constraint_type,table_name,r_owner,r_constraint_name
2 from all_constraints
3 where constraint_type='R'
4 and r_constraint_name in (select constraint_name from all_constraints
5 where constraint_type in ('P','U') and table_name='EMP');
OWNER CONSTRAINT_NAME C TABLE_NAME R_OWNER R_CONSTRAINT_NAME
TEST1 ERL_EMP_FK_1 R EMPLOYEE SCOTT PK_EMP
1 row selected.Means, TEST1 user is having a constraint ERL_EMP_FK_1 on his table EMPLOYEE. Which is using PK_EMP (primary key of SCOTT user's 'EMP' [in the query])
Regards
Girish Sharma -
Give me the sql query which calculte the table size in oracle 10g ecc 6.0
Hi expert,
Please give me the sql query which calculte the table size in oracle 10g ecc 6.0.
RegardsOrkun Gedik wrote:
select segment_name, sum(bytes)/(1024*1024) from dba_segments where segment_name = '<TABLE_NAME>' group by segment_name;
Hi,
This delivers possibly wrong data in MCOD installations.
Depending on Oracle Version and Patchlevel dba_segments does not always have the correct data,
at any time esp. for indexes right after being rebuild parallel (Even in DB02 because it is using USER_SEGMENTS).
Takes a day to get the data back in line (never found out, who did the correction at night, could be RSCOLL00 ?).
Use above statement with "OWNER = " in WHERE for MCOD or connect as schema owner and use USER_SEGMENTS.
Use with
segment_name LIKE '<TABLE_NAME>%'
if you like to see the related indexes as well.
For partitioned objects, a join from dba_tables / dba_indexes to dba_tab_partitions/dba_ind_partitions to dba_segments
might be needed, esp. for hash partitioned tables, depending on how they have been created ( partition names SYS_xxxx).
Volker -
Dear All,
I have a requirement, to write a SQL query to populate the records which are inserted less than 10 no of records.
The tables has the cretaed_date column and along with other key column which will have unique values.
Ex1: The user might have inserted records from application, per week basis, between the date range '01-jun-2013' - 08-jun-2013 , the no of records created by the user during this week may be less than 10 records or more.
But I want to populate the records by giving date range that too, it should pick the records the count which fall with in 10 records.
I dont want the query to populate the records if the user has inserted more than 10 records in a week.
Ex2:
User 1 has created 15 records during the week 1 ( the query should not populate this ).
User 2: has cretaed less than 10 records from the UI during the week 2. ( This details should get populated ).
ThanksUse COUNT to find how many rows where inserted in a week.
If this does not answer your question then please read Re: 2. How do I ask a question on the forums? And provide necessary details. -
SQL query to get the Datetime 06 hours prior to the table Datetime value
Hi Experts,
I'm just trying to create a SQL query to get the Datetime which should be 06 hours prior to my Table column value(Executiontime),
Eg: my Executiontime(column) value is 07:00AM means, this query should fetch the detail of first VMName from table at 01:00AM,
SQL Table Name: TestTable
Columns: VMName(varchar),status(varchar) Executiontime(Datetime)
SQL Query : Select Top 1 VMName from
TestTable where convert(date,Exeutiontime)=convert(date,getdate()) and
status='0' and ExecutionTime > dateadd(hour,6,getdate())
Request someone to alter this Query to my requirement or give me the new one.
Regards,
Sundar
SundarHi All,
Thanks for your Prompt response. I tried the below queries, but still I don't have any luck. Actually the queries are returning the value before the condition met (say when the time difference is more than 06 hours). I want the
query to return exactly @ 06 hour difference or less than 06 hours,
Query 01: Select Top 1 VMName from TestTable where
convert(date,Exeutiontime)=convert(date,getdate())
and status='0'
and ExecutionTime >
dateadd(hour,-6,getdate())
Query 02: Select
Top 1 VMName from TestTable where
status='0'
and ExecutionTime >
dateadd(hour,-6,getdate())
Query 03: Select
Top 1 VMName from TestTable where status='0'
and ExecutionTime >
dateadd(hour,-6,ExecutionTime)
Can someone point out the mistake please.
Regards,
Sundar
Sundar -
Sql query to achive the running division
Hi all, plz help me out with the sql query to achive the below output
create table emp_a (empno number, deptno number, sal number)
insert into emp_a values(901, 10,100);
insert into emp_a values(902, 10,400);
insert into emp_a values(901, 20,300);
insert into emp_a values(902, 20,2100);
i want the ouput in below format
empno deptno sal div_sal
901 10 100 (300/100)
901 20 300 (300/100)
902 10 400 (2100/400)
902 20 2100 (2100/400)
the div_sal column should have the output of greatest sal/second smallest sal for each empnoHi,
781649 wrote:
Hi all, plz help me out with the sql query to achive the below output
create table emp_a (empno number, deptno number, sal number)
insert into emp_a values(901, 10,100);
insert into emp_a values(902, 10,400);
insert into emp_a values(901, 20,300);
insert into emp_a values(902, 20,2100);
i want the ouput in below format
empno deptno sal div_sal
901 10 100 (300/100)
901 20 300 (300/100)
902 10 400 (2100/400)
902 20 2100 (2100/400)
the div_sal column should have the output of greatest sal/second smallest sal for each empnofor empno=901, then second smallest sal is 300. For empno=902, the second smallest sal is 2100.
Instead of "second *smallest* ", do you mean "second *greatest* "?
What if there's a tie (e.g.
INSERT INTO emp_a (empno, deptno, sal) VALUES (903, 10, 300);
INSERT INTO emp_a (empno, deptno, sal) VALUES (903, 20, 300);
INSERT INTO emp_a (empno, deptno, sal) VALUES (903, 30, 200);) Would you count 200 or 300 as the second greatest?
Here's one way:
WITH got_r_num AS
SELECT empno, deptno, sal
, ROW_NUMBER () OVER ( PARTITION BY empno
ORDER BY sal DESC
) AS r_num
FROM emp_a
SELECT e.empno
, e.deptno
, e.sal
, '(' || TO_CHAR (r1.sal)
|| '/'
|| TO_CHAR (r2.sal)
|| ')' AS div_sal
FROM emp_a e
JOIN got_r_num r1 ON e.empno = r1.empno
JOIN got_r_num r2 ON e.empno = r2.empno
WHERE r1.r_num = 1
AND r2.r_num = 2
; -
Sql query to find the balances for a customer account wise.
Hi,
Could someone help me with the sql query to find the balances for each customer account wise. This is need to generate the report.
presently we are using this query, but the output doesnot return the expected result.
SELECT sum(nvl(ps.acctd_amount_due_remaining,0)) "Balance"
FROM ra_cust_trx_line_gl_dist_all gld,
gl_code_combinations c,
ar_payment_schedules_all ps,
RA_CUSTOMER_TRX_ALL rat,
ra_customers rc
WHERE c.CHART_OF_ACCOUNTS_ID = 101
and gld.code_combination_id = c.code_combination_id
and rat.CUSTOMER_TRX_ID=gld.CUSTOMER_TRX_ID
and rat.CUSTOMER_TRX_ID=ps.CUSTOMER_TRX_ID
and ps.customer_id=rc.customer_id
and ps.status='OP'
and ps.gl_date <= :PDATE
and ps.org_id=:PORGID
and ps.class in ('GUAR','INV','DM','DEP')
and c.SEGMENT4=:Account_id
and ps.customer_id=:Customer_id
Thanks in advance.
Kalyan.Can someone help us with this.
Maybe you are looking for
-
Email address change doesn't show in activesync devices
Hi, I changed the PRimary SMTP address for bulk users. There mobile devices still work and e-mail gets sent out there new-email address, but there phones still s how there old e-mail address. So when they reply to all it CC's themselves because it
-
How to capture number of tabular form rows in javascript
Greetings All - I have a tabular form that I created manually. I am looking for a way in javascript to capture the number of rows that are displayed on the page. Is this possible? Regards, Mark
-
Album art added via Itunes 'Get Info' not updating on iPhone 5
Im wanting to use Itunes specifically to add album artwork to my music which is managed manually. With the previous itunes version, it was a case of dragging and dropping a jpeg into the bottom left corner and hey presto! However, now...nothing. Ive
-
I have a ? in the dock for iCal. It cannot be dragged off the dock. When I right+click on the ?, the options menu pops up yet it never says "remove from dock". I have deleted the com.apple.dock.plist and the com.apple.dock.db I have repaired permissi
-
Hai All, I want to implement FLEX in WENDYNPRO ABAP for that i want these files ( FLASHISLANDLIBIMP1.SWF, WDISLANDLIBRARY.SWC).I dont have those files in my server. Can anybody tell me how to configer the files.