USE [DATABASE];
SELECT sc.name +'.'+ ta.name TableName
,SUM(pa.rows) RowCnt
FROM sys.tables ta
INNER JOIN sys.partitions pa
ON pa.OBJECT_ID = ta.OBJECT_ID
INNER JOIN sys.schemas sc
ON ta.schema_id = sc.schema_id
WHERE ta.is_ms_shipped = 0 AND pa.index_id IN (1,0)
GROUP BY sc.name,ta.name
ORDER BY SUM(pa.rows) DESC |
use [DATABASE];
SELECT sc.name +'.'+ ta.name TableName
,SUM(pa.rows) RowCnt
FROM sys.tables ta
INNER JOIN sys.partitions pa
ON pa.OBJECT_ID = ta.OBJECT_ID
INNER JOIN sys.schemas sc
ON ta.schema_id = sc.schema_id
WHERE ta.is_ms_shipped = 0 AND pa.index_id IN (1,0)
GROUP BY sc.name,ta.name
ORDER BY SUM(pa.rows) DESC
dsquery * -filter "(&(objectClass=Computer)(objectCategory=Computer))" -attr sAMAccountName operatingSystem
Come sapete su Windows 8 per accedere alla modalità provvisoria è abbastanza ostico e molto più complesso del “premere f8 all’avvio”.
Fortunatamente c’è la possibilità di riabilitare questa funzionalità digitando in un prompt dei comandi:
bcdedit /set {default} bootmenupolicy legacy |
bcdedit /set {default} bootmenupolicy legacy
Dopo aver lanciato il comando potrete accedere alla modalità provvisoria come avete sempre fatto.
La clausola where permette di impostare delle condizioni sulla selezione che si intende fare.
La sintassi è:
SELECT [campi da visualizzare] FROM [tabella su cui fare la query] WHERE [condizione]; |
SELECT [campi da visualizzare] FROM [tabella su cui fare la query] WHERE [condizione];
Per tutti le dimostrazioni utilizzeremo come tabella di esempio la seguente.
Tabella: SF_personaggi
oppure
Query: SELECT * FROM SF_personaggi;
id nome naz eta mossa
1 Chun-li CHI 26 Lightining Kick
2 Ryu JAP 30 Hadoken
3 Ken USA 29 Shoryuken
4 Balrog USA 26 Dash Straight
5 Zangief USR 38 Double Lariat
6 Blanka BRA 20 Electric Thunder
7 Guile USA 34 Sonic Boom
Query: SELECT * FROM SF_personaggi WHERE id > 4;
id nome naz eta mossa
5 Zangief USR 38 Double Lariat
6 Blanka BRA 20 Electric Thunder
7 Guile USA 34 Sonic Boom
Query: SELECT * FROM SF_personaggi WHERE mossa LIKE 'D%';
id nome naz eta mossa
4 Balrog USA 26 Dash Straight
5 Zangief USR 38 Double Lariat
Query: SELECT * FROM SF_personaggi WHERE id % 2 = 1;
id nome naz eta mossa
1 Chun-li CHI 26 Lightining Kick
3 Ken USA 29 Shoryuken
5 Zangief USR 38 Double Lariat
7 Guile USA 34 Sonic Boom
Il comando SELECT permette l’interrogazione dei dati contenuti in una tabella.
La sintassi è:
SELECT [campi da visualizzare] FROM [tabella su cui fare la query]; |
SELECT [campi da visualizzare] FROM [tabella su cui fare la query];
Per tutti le dimostrazioni utilizzeremo come tabella di esempio la seguente.
Tabella: SF_personaggi
oppure
Query: SELECT * FROM SF_personaggi;
id nome naz eta mossa
1 Chun-li CHI 26 Lightining Kick
2 Ryu JAP 30 Hadoken
3 Ken USA 29 Shoryuken
4 Balrog USA 26 Dash Straight
5 Zangief USR 38 Double Lariat
6 Blanka BRA 20 Electric Thunder
7 Guile USA 34 Sonic Boom
L’asterisco nell’esempio precedente equivale a dire “tutti i campi”. Nell’esempio successivo vedremo come effettuare una proiezione (selezione dei campi da visualizzare)
Query: SELECT nome, eta FROM SF_personaggi;
nome eta
Chun-li 26
Ryu 30
Ken 29
Balrog 26
Zangief 38
Blanka 20
Guile 34
Questo è un semlice ciclo for che se eseguito cambia l’estensione di tutti i file Excel (.xls) in CSV (.csv) nella cartella corrente.
FOR /R %%f IN (*.xls) DO REN "%%f" *.csv |
FOR /R %%f IN (*.xls) DO REN "%%f" *.csv
Per evitare equivoci: il comando non converte i file Excel in CSV, ne modifica solo l’estensione.
Per salvare un file excel in CSV basta selezionare “file” -> “Salva con nome…” -> Selezionare CSV nel menu drop-down “tipo file”.
WinRM 1.1 on Windows XP usually listens on port 80. If you want to change the port it is necessary to execute 2 commands that firstly delete the listener and then recreate it on the port you want to.
Commands are:
winrm delete winrm/config/listener?Address=*+Transport=HTTP
winrm create winrm/config/listener?Address=*+Transport=HTTP @{port="[port number]"} |
winrm delete winrm/config/listener?Address=*+Transport=HTTP
winrm create winrm/config/listener?Address=*+Transport=HTTP @{port="[port number]"}