<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.plecko.hr/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.plecko.hr/feed.php">
        <title>Eureka Moment database:mssql</title>
        <description></description>
        <link>https://wiki.plecko.hr/</link>
        <image rdf:resource="https://wiki.plecko.hr/lib/tpl/bootstrap3/images/favicon.ico" />
       <dc:date>2026-04-04T00:08:07+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.plecko.hr/doku.php?id=database:mssql:backup_to_od&amp;rev=1607515320&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.plecko.hr/doku.php?id=database:mssql:find_gaps&amp;rev=1572509040&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.plecko.hr/doku.php?id=database:mssql:fs_acl&amp;rev=1611749400&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.plecko.hr/doku.php?id=database:mssql:get_serial&amp;rev=1576145640&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.plecko.hr/doku.php?id=database:mssql:install_on_server_core&amp;rev=1572509040&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.plecko.hr/doku.php?id=database:mssql:list_jobs&amp;rev=1606916100&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.plecko.hr/doku.php?id=database:mssql:optimize_instance_shpt&amp;rev=1572509040&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.plecko.hr/doku.php?id=database:mssql:start&amp;rev=1572509040&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.plecko.hr/doku.php?id=database:mssql:sum_datetime_diff&amp;rev=1572509040&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.plecko.hr/lib/tpl/bootstrap3/images/favicon.ico">
        <title>Eureka Moment</title>
        <link>https://wiki.plecko.hr/</link>
        <url>https://wiki.plecko.hr/lib/tpl/bootstrap3/images/favicon.ico</url>
    </image>
    <item rdf:about="https://wiki.plecko.hr/doku.php?id=database:mssql:backup_to_od&amp;rev=1607515320&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-12-09T13:02:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>database:mssql:backup_to_od</title>
        <link>https://wiki.plecko.hr/doku.php?id=database:mssql:backup_to_od&amp;rev=1607515320&amp;do=diff</link>
        <description>Backup MSSQL to OneDrive

'dat.exe' is a utility that outputs the current date in a form of Year,Month,Day,Hour,Minute,Second,DayOfWeek - all with leading zeros. Contact me if you require it. Otherwise change the script to work with system date and time tools</description>
    </item>
    <item rdf:about="https://wiki.plecko.hr/doku.php?id=database:mssql:find_gaps&amp;rev=1572509040&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-10-31T09:04:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>database:mssql:find_gaps</title>
        <link>https://wiki.plecko.hr/doku.php?id=database:mssql:find_gaps&amp;rev=1572509040&amp;do=diff</link>
        <description>Find gaps in sequences in SQL tables

So, you have auto increment column (id) and and want to know if any records have been deleted. For start, you could not delete the records. Instead, use an additional Boolean column, name it 'deleted' and use it to mark them as deleted. And when selecting data, simply add 'where not deleted'. This way, you retain all the data and may choose to 'empty the trash' when you decide.</description>
    </item>
    <item rdf:about="https://wiki.plecko.hr/doku.php?id=database:mssql:fs_acl&amp;rev=1611749400&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-01-27T13:10:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>database:mssql:fs_acl</title>
        <link>https://wiki.plecko.hr/doku.php?id=database:mssql:fs_acl&amp;rev=1611749400&amp;do=diff</link>
        <description>Grant MSSQL instance service access to new data folder

	*  Using Windows Explorer, navigate to the file system location where the database files are stored. Right-click the file system folder, and then click Properties.
	*  On the Security tab, click Edit, and then Add.</description>
    </item>
    <item rdf:about="https://wiki.plecko.hr/doku.php?id=database:mssql:get_serial&amp;rev=1576145640&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-12-12T11:14:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>database:mssql:get_serial</title>
        <link>https://wiki.plecko.hr/doku.php?id=database:mssql:get_serial&amp;rev=1576145640&amp;do=diff</link>
        <description>Get MSSQL serial


Function Get-SqlServerKeys {
	&lt;# 
	 .SYNOPSIS 
		Gets SQL Server Product Keys from local and remote SQL Servers. Works with SQL Server 2005-2014

	 .DESCRIPTION 
		Using a string of servers, a text file, or Central Management Server to provide a list of servers, this script will go to each server and get the product key for all installed instances. Clustered instances are supported as well. Requires regular user access to the SQL instances, SMO installed locally, Remote Regist…</description>
    </item>
    <item rdf:about="https://wiki.plecko.hr/doku.php?id=database:mssql:install_on_server_core&amp;rev=1572509040&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-10-31T09:04:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>database:mssql:install_on_server_core</title>
        <link>https://wiki.plecko.hr/doku.php?id=database:mssql:install_on_server_core&amp;rev=1572509040&amp;do=diff</link>
        <description>Install MSSQL on Windows Server Core

Setup.exe /QS /ACTION=Install /FEATURES=SQL,Replication,IS /INSTANCENAME=MSSQL /SQLSVCACCOUNT=&quot;NT Authority\System&quot; /SQLSYSADMINACCOUNTS=&quot;VK7\Administrator&quot; /AGTSVCACCOUNT=&quot;NT AUTHORITY\Network Service&quot; /SECURITYMODE=SQL /SAPWD=&quot;SA_PASSWORD&quot; /TCPENABLED=1 /IACCEPTSQLSERVERLICENSETERMS</description>
    </item>
    <item rdf:about="https://wiki.plecko.hr/doku.php?id=database:mssql:list_jobs&amp;rev=1606916100&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-12-02T14:35:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>database:mssql:list_jobs</title>
        <link>https://wiki.plecko.hr/doku.php?id=database:mssql:list_jobs&amp;rev=1606916100&amp;do=diff</link>
        <description>MSSQL - Query Jobs with Owners


SELECT s.name AS JobName, l.name AS JobOwner
FROM msdb..sysjobs s
LEFT JOIN master.sys.syslogins l ON s.owner_sid = l.sid
WHERE l.name IS NOT NULL
ORDER by l.name



USE msdb ;
GO
EXEC dbo.sp_manage_jobs_by_login
@action = N'REASSIGN',
@current_owner_login_name = N'sa'
@new_owner_login_name = N'QUICK\Pinal', ;
GO</description>
    </item>
    <item rdf:about="https://wiki.plecko.hr/doku.php?id=database:mssql:optimize_instance_shpt&amp;rev=1572509040&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-10-31T09:04:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>database:mssql:optimize_instance_shpt</title>
        <link>https://wiki.plecko.hr/doku.php?id=database:mssql:optimize_instance_shpt&amp;rev=1572509040&amp;do=diff</link>
        <description>Optimize SQL instance for SharePoint

Alrighty then! You've succesfully installed SQL and now you need to install Sharepoint and “hook it up” to Your fresh new instance. Well STOP here and do continue reading this. It just might save You a lot of fuss later.</description>
    </item>
    <item rdf:about="https://wiki.plecko.hr/doku.php?id=database:mssql:start&amp;rev=1572509040&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-10-31T09:04:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>database:mssql:start</title>
        <link>https://wiki.plecko.hr/doku.php?id=database:mssql:start&amp;rev=1572509040&amp;do=diff</link>
        <description>MSSql




	* Backup MSSQL to OneDrive
	* Find gaps in sequences in SQL tables
	* Get MSSQL serial
	* Grant MSSQL instance service access to new data folder
	* Install MSSQL on Windows Server Core
	* MSSQL - Query Jobs with Owners
	* Optimize SQL instance for SharePoint
	* Sum datetime difference in MSSQL</description>
    </item>
    <item rdf:about="https://wiki.plecko.hr/doku.php?id=database:mssql:sum_datetime_diff&amp;rev=1572509040&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-10-31T09:04:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>database:mssql:sum_datetime_diff</title>
        <link>https://wiki.plecko.hr/doku.php?id=database:mssql:sum_datetime_diff&amp;rev=1572509040&amp;do=diff</link>
        <description>Sum datetime difference in MSSQL

Get the SUM of seconds:

SET @Seconds = SELECT SUM(DATEDIFF(SECOND, [START_TIME], [END_TIME]))

Turn that into a datetime object:

SELECT CONVERT(VARCHAR(8), dateadd(SECOND, @Seconds, 0), 108)

Or as 1 query:

SELECT CONVERT(VARCHAR(8), dateadd(SECOND, SUM(DATEDIFF(SECOND, [START_TIME], [END_TIME])), 0), 108)</description>
    </item>
</rdf:RDF>
