NEWID() itself a function. when the called returns a GUID value.
You do not need to put it in a separate window, and then copy the value of the fingerprint. Just put this function where you want to get the GUID value, and when the request is executed at run time, the value returned by this function will be used.
For example, in the Insert statement
INSERT INTO TableName (Col1 , Col2, Col3) VALUES (1 , 'Value 1', NEWID())
If you want col3 to have a GUID value, you do not need to copy the paste the value returned from the NEWID () function, but you use this function. At runtime, the guid value will be reconfigured and inserted into col3.
Similarly, if you update
UPDATE TableName SET Col3 = NEWID() WHERE <Some Condition>
Again, you don’t need to copy the insert, the value returned from the NEWID () function, just the function itself is used.
Another option would be to assume that you are somewhere inside your code where you cannot call the NEWID() function. You would declare a variable of type UNIQUEIDENTIFIER, calling the function to save its value to this variable, and then use this variable inside the code, for example ...
DECLARE @GUID_Value UNIQUEIDENTIFIER; SET @GUID_Value = NEWID();
Add to keyboard shortcut
For some strange reason, if you want to add a shortcut to your SSMS to generate a GUID for you. You would need two things.
- Create a stored procedure that returns a GUID value.
- Add a key shortcut to call the stored procedure.
Definition of Proc
CREATE PROCEDURE get_Guid AS SELECT NEWID();
Add it to shortcuts
From your SSMS goto Tools -> Options -> Environment -> Keyboard
add the name of the stored procedure to the shortcut you want. Click OK. Close SSMS and open it again and you will go well.

As shown in the above snapshot, now if you press CTRL + 0 , it will generate a GUID value for you in the same query window.