Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Help needed with NewId() As CustomerId

$
0
0

I would like to generate Guid for each customerName with Insert statement.

I have problem that following statement would create Guid for each single row.
This is problem because same customer have several rows in table. Is this possible without creating temp tables?

How to generate guid so that there is one CustomerId for each Customer Name?

Following statement is working for me as it generated Guid for every single row instead of every single customerName.

SELECT NewId() As CustomerId, CustomerName,YearId, CustomerSales
FROM Customer


Kenny_I


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>