<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>http://wiki.sage.fr/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="http://wiki.sage.fr/index.php?action=history&amp;feed=atom&amp;title=Scripts_sql_%28maintenance%29"/>
	<link rel="alternate" type="text/html" href="http://wiki.sage.fr/index.php?title=Scripts_sql_(maintenance)&amp;action=history"/>
	<updated>2026-05-25T06:59:02Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>http://wiki.sage.fr/index.php?title=Scripts_sql_(maintenance)&amp;diff=14557&amp;oldid=prev</id>
		<title>Syfre : /* RootOID */</title>
		<link rel="alternate" type="text/html" href="http://wiki.sage.fr/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 dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;RootOID&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&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; id=&quot;mw-diff-left-l45&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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;DEALLOCATE tables_cursor&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;DEALLOCATE tables_cursor&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&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; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;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; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{tip|La valeur de RootOID est stockée dans la séquence &quot;RootOID&quot; de la base}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Base de données]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&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>http://wiki.sage.fr/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&#039;OID d&#039;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="http://wiki.sage.fr/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&amp;#039;OID d&amp;#039;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=&amp;#039;RootOID&amp;#039;&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=&amp;#039;oid&amp;#039;&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 = &amp;#039;select @TableUID = MAX(convert(INT,  CONVERT(VARBINARY,&amp;#039;&amp;#039;0x&amp;#039;&amp;#039;+SUBSTRING(oid,21,8),1) )) from &amp;#039;+ @TableName&lt;br /&gt;
  EXEC sp_executesql  @SQL, N&amp;#039;@TableUID int OUTPUT, @TableName varchar&amp;#039;, @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>