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 12»»

What is @Dummy ? Expand / Collapse
Author
Message
Posted Thursday, May 16, 2013 7:49 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, August 25, 2014 11:46 AM
Points: 98, Visits: 241
Hello all!

I've been assigned to deconstruct and document a rather large Stored Procedure (SQL 2008). This procedure simply declared about a dozen of other procedures with I will need to anaylize and document. I'm coming into an environment where a handleful of other developers wrote, programmed, and left and not a damn thing was documented. So, I along with the help of someone else, are decontructing it all and documenting it.

Anyway, the SP starts off like this:


ALTER PROCEDURE [dbo].[The Name of this very SP]
(@Dummy varchar(20))
as

Exec [SP #1] 1
Exec [SP #2] 1

...and so on.

I have two questions.

1) What does @Dummy do?

2) What do the "1" indicate after firing off each SP?

Thanks in advance for your help!!


Post #1453545
Posted Thursday, May 16, 2013 7:55 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:31 AM
Points: 40,456, Visits: 36,912
Can't tell for sure, since you only posted part of the code, but the @Dummy parameter does nothing in the code you posted. Perhaps it's used elsewhere.

The 1 after the procedure calls is a parameter value, like
exec sp_help 'Test'



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1453550
Posted Thursday, May 16, 2013 8:02 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, August 25, 2014 11:46 AM
Points: 98, Visits: 241
Thanks for helping. Here is is all cleaned up:


USE [Database name]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[THIS SP NAME](
@Dummy varchar(20)
)
as


Exec [SP #1] 1
Exec [SP #2]
Exec [SP #3] 1
Exec [SP #4] 1

...an so on...


That's it.


If I peak into SP #1, I see this:


ALTER PROCEDURE [dbo].[SP #1](
@Test int
)
AS
Truncate table [Table Name]


Thoughts?

Post #1453559
Posted Thursday, May 16, 2013 8:05 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:31 AM
Points: 40,456, Visits: 36,912
RedBirdOBX (5/16/2013)
Thoughts?


The developers were smoking something.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1453561
Posted Thursday, May 16, 2013 8:11 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, August 25, 2014 11:46 AM
Points: 98, Visits: 241
This is just the tip too.....

No idea?
Post #1453571
Posted Thursday, May 16, 2013 8:45 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 7:33 AM
Points: 2,873, Visits: 5,190
GilaMonster (5/16/2013)
RedBirdOBX (5/16/2013)
Thoughts?


The developers were smoking something.


... smoking something from Amsterdam and drinking strong clear thing from Eastern lands of Europe...



_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1453590
Posted Thursday, May 16, 2013 9:01 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:31 AM
Points: 40,456, Visits: 36,912
RedBirdOBX (5/16/2013)
No idea?


The parameters are meaningless and never used.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1453605
Posted Thursday, May 16, 2013 9:02 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, August 25, 2014 11:46 AM
Points: 98, Visits: 241
That's what I'm finding out.

Thanks!
Post #1453606
Posted Thursday, May 16, 2013 11:34 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Tuesday, November 25, 2014 3:14 PM
Points: 4,363, Visits: 9,545
Total WAG...but I have seen things like this where the developers were informed (for whatever reason) that stored procedures require a parameter and therefore they built everything with a parameter whether or not it was used.

I have also seen similar development methods used when the developers built a generic utility in code and that utility required all stored procedures to have a parameter - because if it didn't, their nice little generic utility would break.


Jeffrey Williams
Problems are opportunites brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs
Post #1453705
Posted Friday, May 17, 2013 7:58 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Sunday, September 29, 2013 1:24 AM
Points: 429, Visits: 1,721
Jeffrey Williams 3188 (5/16/2013)
Total WAG...but I have seen things like this where the developers were informed (for whatever reason) that stored procedures require a parameter and therefore they built everything with a parameter whether or not it was used.

I have also seen similar development methods used when the developers built a generic utility in code and that utility required all stored procedures to have a parameter - because if it didn't, their nice little generic utility would break.


+1

 
Post #1454020
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse