I'm need a way to take a UniqueID value generated from this query:
Code:
Code:
Use ExampleDB
Go
Select NEWID() from tblName
Which generates a unique value like this:
I normally copy and past this value into the column where it goes, but I would rather create a script to do so for me. The problem is that it does not insert the generated value into a table but rather a "results" window, so I don't know where to pull the data from to insert it.
I'm need a way to take a UniqueID value generated from this query:
Code:
Code:
Use ExampleDB
Go
Select NEWID() from tblName
Which generates a unique value like this:
I normally copy and past this value into the column where it goes, but I would rather create a script to do so for me. The problem is that it does not insert the generated value into a table but rather a "results" window, so I don't know where to pull the data from to insert it.
Boy was I really overthinking that one. Thanks a lot for the help.
I have been doing some light scripting trying to streamline some of the more redundant tasks for when we ship out servers to new customers. The problem is, the guy who had the position before me was worse with SQL than I am so he really didn't leave much behind in the ways of useful scripts to learn from. I guess he just did everything manually which is pretty ridiculous considering the amount of hours time it takes to do it all by hand, opposed to learning how to write a few basic scripts and do it all in a few minutes.
As basic as it is, here is my final solution;
Code:
Code:
Use ExampleDB
Go
update tblTableName
set ColumnName = NewID()
That's it. Worked like a charm. This is going to be part of a much larger script that does many tasks btw.
Thanks again, you guys might be seeing me back from time to time as I get stuck on things.
PS: Good to see you are still around Duckie. I've been coming back to OCN slowly now that I have a new comfy position with more free time.
Boy was I really overthinking that one. Thanks a lot for the help.
I have been doing some light scripting trying to streamline some of the more redundant tasks for when we ship out servers to new customers. The problem is, the guy who had the position before me was worse with SQL than I am so he really didn't leave much behind in the ways of useful scripts to learn from. I guess he just did everything manually which is pretty ridiculous considering the amount of hours time it takes to do it all by hand, opposed to learning how to write a few basic scripts and do it all in a few minutes.
As basic as it is, here is my final solution;
Code:
Code:
Use ExampleDB
Go
update tblTableName
set ColumnName = NewID()
That's it. Worked like a charm. This is going to be part of a much larger script that does many tasks btw.
Thanks again, you guys might be seeing me back from time to time as I get stuck on things.
PS: Good to see you are still around Duckie. I've been coming back to OCN slowly now that I have a new comfy position with more free time.
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Related Threads
?
?
?
?
?
Ask a question
Ask a question
Overclock.net
27.8M posts
541.2K members
Since 2004
A forum community dedicated to overclocking enthusiasts and testing the limits of computing. Come join the discussion about computing, builds, collections, displays, models, styles, scales, specifications, reviews, accessories, classifieds, and more!