Featured image of post PC-Market: zmiana kodów krótkich na wagowe

PC-Market: zmiana kodów krótkich na wagowe

PC-Market: zmiana kodów krótkich na wagowe

1
2
3
4
5
6
7
Select * from Towar where kod like '29%'

Select getdate(), '29' + right('0000' + kod, 4) + '???????', * from Towar where JMid = 2 AND len(kod) <=4 order by kod

UPDATE Towar set kod = '29' + right('0000' + kod, 4) + '???????', zmiana = getdate(), zmianaistotna = getdate() where JMid = 2 AND len(kod) <=4 

-- AND asid not in(134,132)

lub tak:

1
2
3
4
5
6
UPDATE [dbo].[Towar]
   SET [Kod] = cast(290000 + cast(kod as int) as varchar) + '???????'
   WHERE Towid < 10
GO

select * from towar where towid < 50
comments powered by Disqus
Zbudowano z Hugo
Motyw Stack zaprojektowany przez Jimmy