Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 30th, 2004, 04:35 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default Insert into

Hello Everyone,

I will like to take this select statement and insert the results into a table called SQL_Version. can ecyon help?

select SERVERPROPERTY('productversion')As ProductVersion, SERVERPROPERTY ('productlevel')as ProductLevel, SERVERPROPERTY ('edition')as SQLEdition,@@SERVERName

this select statement will give me the SQL version information. What I want to eventually do is run this on every SQL server ang egt the results.

__________________
Jaime E. Maccou
Reply With Quote
  #2 (permalink)  
Old March 31st, 2004, 03:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

INSERT SQL_Version
select SERVERPROPERTY('productversion')As ProductVersion, SERVERPROPERTY ('productlevel')as ProductLevel, SERVERPROPERTY ('edition')as SQLEdition,@@SERVERName

is that what you're looking for?
Reply With Quote
  #3 (permalink)  
Old March 31st, 2004, 07:31 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Thank you for your response

This is what I did

1.created a linked server on all my servers
2.created a view to capture result from select statement
2.created a store procedure to call results from view
4.used cast to change data type
3.schedule a job on all servers to insert to the linked server

create view sqlversion
as
SELECT  SERVERPROPERTY('productversion')as ProductVersion, SERVERPROPERTY ('productlevel')as ProductLevel, SERVERPROPERTY ('edition')as Edition,@@servername as ServerName


CREATE procedure sp_sqlversions
as
INSERT INTO [SQL_versions].[database].[dbo].[sql_version]
SELECT  CAST(ProductVersion AS varchar(50)) AS ProductVersion, CAST(ProductLevel AS varchar(50)) AS ProductLevel,
                      CAST(Edition AS varchar(50)) AS Edition,@@SERVERNAME AS ServerName
FROM  dbo.SQLVersion
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert " ". Somesh XML 1 March 6th, 2007 12:30 PM
How to insert " ". Somesh C# 1 March 6th, 2007 07:45 AM
insert into U.N.C.L.E. SQL Language 3 June 6th, 2006 06:35 PM
trigger to insert current date on insert kev_79 SQL Server 2000 3 January 23rd, 2006 04:58 PM
"INSERT INTO" kaz SQL Language 7 December 15th, 2003 06:40 PM



All times are GMT -4. The time now is 02:29 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.