Update Table A column from Table B

update TableA set col = TableB.col
from TableA, TableB
where TableA.matchCol = TableB.matchCol

Advertisements

Build SQL from Excel sheet

Use this Excel function to build insert statements from Excel data:

=”insert into [table name] select max(id)+1 , ‘”&A2&”‘ from [table name]”


SQL Order tables by creation date

SELECT
[name]
,create_date
,modify_date
FROM
sys.tables
order by 2 desc


Excel row formatting rules

A great tutorial on different formatting rules:
https://www.ablebits.com/office-addins-blog/2013/10/29/excel-change-row-background-color/


XPath Example – Attributes

This line will find the familyName attributes and thier values in TradeXML:

/TP3Message/BusinessMessage/TP3CatalogUploadRequest/TP3CatalogUploadRequestItems/Product/PIData/ProductFamily/@familyName

This line will find the values of nodes where attribute ‘name’ = ‘subject’:

/TP3Message/BusinessMessage/TP3CatalogUploadRequest/TP3CatalogUploadRequestItems/Product/OtherData/Assets/Asset/AssetProperty[@name='subject']

Sketchflow – ChangePropertyAction

One thing I wanted to do was show/hide some elements. This is actually quite easy:

Assets -> Behaviours -> ChangePropertyAction

Then you set the visibility property on which ever trigger you like.

This blog lead me to it:
http://www.silverlightbuzz.com/2009/07/14/using-sketchflow-and-behaviors-for-quick-easy-demos/

 

Interesting read:

http://www.silverlightshow.net/items/Sketchflow-from-a-developer-point-of-view-Part-II-Dev-Stuff.aspx


SQL – Fill a column with a value

update [table] set [column] = ‘value’

 

Example:

alter table PI_15_0_0_SV add Language nchar(2) not null default ‘SV’ with values

insert into pi_15_0_0 select * from PI_15_0_0_SV