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

System proc sp_SysInfo to get Expand / Collapse
Author
Message
Posted Monday, February 20, 2012 10:48 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, August 30, 2014 3:47 PM
Points: 20, Visits: 300
Comments posted to this topic are about the item System proc sp_SysInfo to get
Post #1255004
Posted Tuesday, February 28, 2012 9:53 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, May 16, 2014 12:39 PM
Points: 93, Visits: 300
trying to save this as a stored procedure in SQL2005, but am getting an error: Cannot assign a default value to a local variable.

Any help is greatly appreciated, thanks!
Post #1259013
Posted Tuesday, February 28, 2012 11:22 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, August 30, 2014 3:47 PM
Points: 20, Visits: 300
sql 2005 does not allow assigning values to a variable during declaration. You can have the declare done first and then assign the values to the declared variables.
I have not tested this script on sql 2005, I do not have one setup. If things do not work as a complete package in sql 2005 you can get rid of the pieces that does not work and use the rest if you'd like.
Post #1259069
Posted Tuesday, February 28, 2012 11:29 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, August 30, 2014 3:47 PM
Points: 20, Visits: 300
A sample if you need it

--SQL2008++
DECLARE @i INT = 5,
@k INT = 6
GO
--SQL2005++
DECLARE @i INT,
@k INT

SELECT @i = 5,
@k = 6
GO
-- SQL2005++
DECLARE @i INT,
@k INT

SET @i = 5
SET @k = 6
Post #1259071
Posted Thursday, March 1, 2012 12:42 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, May 16, 2014 12:39 PM
Points: 93, Visits: 300
when trying to copy and paste this script into my SQL manager studio, it gives me a ton of "Incorrect syntax near ' '." errors due to the characters spaces in each line. Am I copying this wrong from the site, or is there an easier way to remove these so the script will run?

thanks!
Post #1260397
Posted Thursday, March 1, 2012 12:54 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, August 30, 2014 3:47 PM
Points: 20, Visits: 300
try to copy and paste into word first and then paste it to notepad to see if the off characters are removed then copy it to management studio.
Post #1260404
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse