<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://frp.sage.fr/wiki1000/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
		<id>https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=Scripts_sql_%28maintenance%29</id>
		<title>Scripts sql (maintenance) - Historique des versions</title>
		<link rel="self" type="application/atom+xml" href="https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=Scripts_sql_%28maintenance%29"/>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=Scripts_sql_(maintenance)&amp;action=history"/>
		<updated>2026-04-26T23:59:40Z</updated>
		<subtitle>Historique pour cette page sur le wiki</subtitle>
		<generator>MediaWiki 1.18.6</generator>

	<entry>
		<id>https://frp.sage.fr/wiki1000/index.php?title=Scripts_sql_(maintenance)&amp;diff=14557&amp;oldid=prev</id>
		<title>Syfre : /* RootOID */</title>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=Scripts_sql_(maintenance)&amp;diff=14557&amp;oldid=prev"/>
				<updated>2023-11-27T08:41:35Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;RootOID&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Version précédente&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Version du 27 novembre 2023 à 08:41&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 45 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 45 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;DEALLOCATE tables_cursor&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;DEALLOCATE tables_cursor&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;{{tip|La valeur de RootOID est stockée dans la séquence &amp;quot;RootOID&amp;quot; de la base}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Base de données]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Base de données]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Syfre</name></author>	</entry>

	<entry>
		<id>https://frp.sage.fr/wiki1000/index.php?title=Scripts_sql_(maintenance)&amp;diff=14556&amp;oldid=prev</id>
		<title>Syfre : Page créée avec « ===RootOID===  Retourne le max des racines d'OID d'une base de données avec OID caractères.  &lt;pre&gt; DECLARE @SQL nvarchar(max) DECLARE @TableName sysname DECLARE @TableUI... »</title>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=Scripts_sql_(maintenance)&amp;diff=14556&amp;oldid=prev"/>
				<updated>2023-11-27T08:26:08Z</updated>
		
		<summary type="html">&lt;p&gt;Page créée avec « ===RootOID===  Retourne le max des racines d&amp;#039;OID d&amp;#039;une base de données avec OID caractères.  &amp;lt;pre&amp;gt; DECLARE @SQL nvarchar(max) DECLARE @TableName sysname DECLARE @TableUI... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;===RootOID===&lt;br /&gt;
&lt;br /&gt;
Retourne le max des racines d'OID d'une base de données avec OID caractères.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DECLARE @SQL nvarchar(max)&lt;br /&gt;
DECLARE @TableName sysname&lt;br /&gt;
DECLARE @TableUID int&lt;br /&gt;
DECLARE @RootOID int&lt;br /&gt;
&lt;br /&gt;
DECLARE @MaxUID int&lt;br /&gt;
DECLARE @MaxTableName sysname&lt;br /&gt;
&lt;br /&gt;
SELECT @MaxUID = 0&lt;br /&gt;
SELECT @RootOID = cValue from sysCounter where cName='RootOID'&lt;br /&gt;
&lt;br /&gt;
DECLARE tables_cursor CURSOR FAST_FORWARD&lt;br /&gt;
FOR&lt;br /&gt;
select t.name from sys.all_columns c&lt;br /&gt;
join sys.tables t on t.object_id = c.object_id&lt;br /&gt;
where c.name='oid'&lt;br /&gt;
&lt;br /&gt;
OPEN tables_cursor&lt;br /&gt;
&lt;br /&gt;
FETCH NEXT FROM tables_cursor INTO @TableName&lt;br /&gt;
&lt;br /&gt;
WHILE @@FETCH_STATUS = 0&lt;br /&gt;
BEGIN &lt;br /&gt;
  SELECT @SQL = 'select @TableUID = MAX(convert(INT,  CONVERT(VARBINARY,''0x''+SUBSTRING(oid,21,8),1) )) from '+ @TableName&lt;br /&gt;
  EXEC sp_executesql  @SQL, N'@TableUID int OUTPUT, @TableName varchar', @TableUID OUTPUT, @TableName = @TableName&lt;br /&gt;
&lt;br /&gt;
  IF (@TableUID &amp;gt; @MaxUID ) &lt;br /&gt;
   BEGIN &lt;br /&gt;
     SELECT @MaxUID=@TableUID&lt;br /&gt;
	 SELECT @MaxTableName = @TableName&lt;br /&gt;
   END&lt;br /&gt;
&lt;br /&gt;
  FETCH NEXT FROM tables_cursor INTO @TableName&lt;br /&gt;
&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
SELECT @MaxTableName, @MaxUID, @RootOID&lt;br /&gt;
&lt;br /&gt;
CLOSE tables_cursor&lt;br /&gt;
DEALLOCATE tables_cursor&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Base de données]]&lt;/div&gt;</summary>
		<author><name>Syfre</name></author>	</entry>

	</feed>