sql Configurar Etiquetas

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql Configurar Etiquetas相关的知识,希望对你有一定的参考价值。

--Chain Alim (143, 303, 302)
--Chain Não Aliment (401, 306, 600, 330, 740, 500, 301)

DECLARE @ChainId varchar(18) = '306'
DECLARE @RetailStoreId varchar(5)
DECLARE @RetailStoreNumber int
DECLARE @LabelId bigint
DECLARE @LabelRetailStore_Count int

SET @RetailStoreNumber = 0

SELECT TOP 1 @RetailStoreId = RetailStoreId
FROM ra.RetailStore
WHERE LEFT(RetailStoreId, 1) = 'S' AND ChainId = @ChainId
ORDER BY CONVERT(int, REPLACE(RetailStoreId, 'S', ''))
	
WHILE (@RetailStoreId <> '')
BEGIN
	SET @RetailStoreId = ''

	SELECT TOP 1 @RetailStoreId = RetailStoreId
	FROM ra.RetailStore
	WHERE LEFT(RetailStoreId, 1) = 'S' AND ChainId = @ChainId
	AND CONVERT(int, REPLACE(RetailStoreId, 'S', '')) > @RetailStoreNumber
	ORDER BY CONVERT(int, REPLACE(RetailStoreId, 'S', ''))
		
	IF (@RetailStoreId <> '')
	BEGIN
		DECLARE CUR_Label CURSOR FOR
		SELECT LabelId FROM ra.Label WHERE LabelId IN (
		89
		)
		OPEN CUR_Label
		FETCH CUR_Label INTO @LabelId

		WHILE @@FETCH_STATUS=0
		BEGIN
			IF (@LabelId > 0)
			BEGIN
				SELECT @LabelRetailStore_Count = COUNT(1)
				FROM ra.LabelRetailStore
				WHERE RetailStoreId = @RetailStoreId AND LabelId = @LabelId
				
				IF (@LabelRetailStore_Count = 0)
					INSERT INTO ra.LabelRetailStore (RetailStoreId, LabelId, LastUpdateUser, LastUpdateDate, IsMarkdownDefault)
					VALUES (@RetailStoreId, @LabelId, 'MRS', GETDATE(), 0)
			END

			FETCH CUR_Label INTO @LabelId
		END
			
		SET @RetailStoreNumber = CONVERT(int, REPLACE(@RetailStoreId, 'S', ''))
		CLOSE CUR_Label
		DEALLOCATE CUR_Label
	END
END

以上是关于sql Configurar Etiquetas的主要内容,如果未能解决你的问题,请参考以下文章

sql Ajuste de asignaturas mostradas al configurar una nueva asignatura a un plan de estudios - TIC

markdown Etiquetas.md

php Ocultar etiquetas de campos en Gravity Forms

php Configurar SMTP WP

text Guia para configurar登录con google

markdown Configurar Registro MX en otro servidor