MSSQL – get current running SQL queries
SELECT sqltext.TEXT, req.session_id, req.status, req.command, req.cpu_time, req.total_elapsed_time FROM sys.dm_exec_requests req CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
SELECT sqltext.TEXT, req.session_id, req.status, req.command, req.cpu_time, req.total_elapsed_time FROM sys.dm_exec_requests req CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
element = $("input:radio.someClass:checked");
value = $("input:radio.someClass:checked").val();
<% FUNCTION stripHTML(strHTML) Dim objRegExp, strOutput, tempStr Set objRegExp = New Regexp objRegExp.IgnoreCase = True objRegExp.Global = True objRegExp.Pattern = "<(.|n)+?>" 'Replace all HTML tag matches with the empty string strOutput = objRegExp.Replace(strHTML, "") 'Replace all < and > with < and > strOutput = Replace(strOutput, "<", "<") strOutput = Replace(strOutput, ">", ">") stripHTML = strOutput 'Return the value of strOutput Set objRegExp = Nothing END FUNCTION %>
source: https://gist.github.com/gwobcke/1027133
<% Function StripSpecialChar(strInput) Dim objRegExp Set objRegExp = New Regexp objRegExp.IgnoreCase = True objRegExp.Global = True objRegExp.Pattern = "[\+\#\@\&\%\$\?\*]" '//Replace all character matches with an Empty String StripSpecialChar = objRegExp.Replace(strInput, "") Set objRegExp = Nothing End Function %>
source: https://gist.github.com/gwobcke/1027138/revisions
Function InArray(Needle, Haystack)
Dim i, x
InArray = False
For i = 0 To Ubound(Haystack)
If IsArray(Needle) = True Then
For x = 0 To Ubound(Needle)
If Trim(Haystack(i)) = Trim(Needle(x)) Then
InArray = True
Exit Function
End If
Next
Else
If Trim(Haystack(i)) = Trim(Needle) Then
InArray = True
Exit Function
End If
End If
Next
End Function
SOURCE: https://gist.github.com/gwobcke/1044367
Option Explicit
dim list
Set list = CreateObject("System.Collections.ArrayList")
list.Add "Banana"
list.Add "Apple"
list.Add "Pear"
'list.Sort
'list.Reverse
response.write list.Count ' --> 3
response.write list.Item(0) ' --> Pear
response.write list.IndexOf("Apple", 0) ' --> 2
response.write join(list.ToArray(), ", ") ' --> Pear, Banana, Apple
source: https://stackoverflow.com/questions/13585660/lists-in-vbscript
<div>This is a test</div>
<div><span>Another Div</span></div>
$('div:contains("Another")').css('background-color', 'red');
select 'set identity_insert ['+s.name+'].['+o.name+'] off' from sys.objects o inner join sys.schemas s on s.schema_id=o.schema_id where o.[type]='U' and exists(select 1 from sys.columns where object_id=o.object_id and is_identity=1)
Then copy & paste the resulting SQL into another query window and run
source: https://stackoverflow.com/questions/10116759/set-identity-insert-off-for-all-tables
Using CFSet
Creating a copy of a Structure using CFSet will result in a new variable having a reference to the original Structure;
changes will affect the original Structure.
******************************************************
Using Duplicate
Creating a copy of a Structure using Duplicate will result in a new variable containing no reference to the original Structure but rather a snapshot of its current contents.
changes will NOT affect the original Structure.
******************************************************
Using Strcutcopy
Strcutcopy is where most people get confused.
We can say Structcopy is between CFSet and Duplicate.
When we use Structcopy, a new structure will be created; however, references to nested structures, objects, and query variables will be maintained from the original Structure.
changes will affect the original Structure.
******************************************************
SELECT
t.NAME AS TableName,
i.name as indexName,
p.[Rows],
sum(a.total_pages) as TotalPages,
sum(a.used_pages) as UsedPages,
sum(a.data_pages) as DataPages,
(sum(a.total_pages) * 8 ) / 1024 as TotalSpaceMB,
(sum(a.used_pages) * 8 ) / 1024 as UsedSpaceMB,
(sum(a.data_pages) * 8 ) / 1024 as DataSpaceMB
FROM
sys.tables t
INNER JOIN
sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN
sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN
sys.allocation_units a ON p.partition_id = a.container_id
WHERE
t.NAME NOT LIKE 'dt%' AND
i.OBJECT_ID > 255 AND
i.index_id <= 1
GROUP BY
t.NAME, i.object_id, i.index_id, i.name, p.[Rows]
ORDER BY
object_name(i.object_id)
https://stackoverflow.com/questions/1443704/query-to-list-number-of-records-in-each-table-in-a-database