Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to ADD a SQL SERVER name in every row of a table. Expand / Collapse
Author
Message
Posted Tuesday, January 29, 2013 1:07 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, July 16, 2013 9:03 AM
Points: 144, Visits: 640
Hi Development Guys,


I need to add a column in a SQL server database table ( which i have done). Now i have to add SQL SERVER name on every row of the table in this new column ( same entry on every row).


Can some please help me how to accomplish that?


Thanks in advance.
Post #1413282
Posted Tuesday, January 29, 2013 1:08 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:09 PM
Points: 6,251, Visits: 7,411
UPDATE table SET newcol = @@SERVERNAME

Unless I'm really not understanding the question?



- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1413285
Posted Tuesday, January 29, 2013 6:30 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, July 16, 2013 9:03 AM
Points: 144, Visits: 640
Thanks a lot, i already found the update statement and it solved my problem.... Thanks again.
Post #1413409
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse