Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 decrypt store procedure ?

Author  Topic 

sasan_vm
Yak Posting Veteran

51 Posts

Posted - 2011-12-30 : 04:29:16
Hi,

How can decrypt encrypted store procedure ? Is it possible ?

Regards,
sasan.

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-12-30 : 04:59:52
Sure it's possible, did you try a google search (because I know there will be lots and lots of results)?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-30 : 05:43:54
quote:
Originally posted by sasan_vm

How can decrypt encrypted store procedure ? Is it possible ?



You won't get a specific answer here as the MODs don't permit discussion of cracks and the like.

Are you hacking someone else's code? or is this an accident that you used WITH ENCRYPT and now realise that you have no other copy of the SProc source? (If so restore from earlier backup and extract it from there, and I recommend that you save all Sproc source on DISK rather than relying on the version in the database - e.g. did you know that having certain types of block comment at the start of your Sproc can ALSO render it unretrievable using right-click-EDIT )
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2011-12-30 : 09:36:17
quote:


e.g. did you know that having certain types of block comment at the start of your Sproc can ALSO render it unretrievable using right-click-EDIT )



REALLY? I did not know that.

care to share an example?

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-30 : 12:56:41
I was hoping you wouldn't ask ... I'll have to go find one now ...
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-30 : 13:13:14
OK, I think this is the issue:

http://blog.wassupy.com/2011/02/recovering-from-sql-server-error-syntax.html
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-30 : 13:18:03
Sample code:

/* Comment Block
EXEC MyTestSProc
@intParm1=3 /*explanation*/
,@intParm2=null /*explanation*/
*/

CREATE PROCEDURE [dbo].MyTestSProc
@intParm1 int = NULL
,@intParm2 int = NULL
AS
SELECT [MyTest] = 1
GO

-- Test that it works:

EXEC [dbo].MyTestSProc
GO

-- Use Right-Click MODIFY in SSMS (you should get an error)

-- Then clean up :
-- DROP PROCEDURE [dbo].MyTestSProc
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-12-30 : 13:56:39
Heh! Kristen, I didn't believe you, so I had to test it for myself. And, now I believe you, it is indeed a "feature" even on SQL 2008 R2.

Luckily for me, I never use those /* and */ type of comments. When I want to comment a block, I use the control-k,control-c to comment (which puts the two-hypen type of comments), and control-k,control-u to uncomment.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-30 : 14:19:53
"I had to test it for myself."

Yeah, but my point is "store your Source Code externally to the database", otherwise there are things that could spoil your day - including a BUG in SSMS.

We use a Revision Control System (in our case its "SVN" and "Tortoise") which has the added benefit of allowing us to see any previous version of the source code, and making it easy to work out WHAT to deploy to a Client to get them from Version-A to version-N
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-12-30 : 17:03:33
Of course! We use TFS with RedGate Source Control. In my mind, I always thought of source control more in terms of version control, revision history etc. than as a means for recovering from stuff like this.
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2011-12-31 : 05:09:35
Ah -- so is the problem that there is some sort of nested /* */ block in there? Or does adding that kind of comment trigger some sort of ssms auto-doc feature?

For the record -- we use SVN and SQL Source Control. SQL Source Control has been very disappointing compared to some of the other red-gate tools liks SQL Compare (which is amazing).

Anyway, probably hijacking the thread....

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-31 : 07:05:29
"so is the problem that there is some sort of nested /* */ block in there?"

Yup, wouldn't normally happen of course (surprised that SQL doesn't treat it as an error, with nested BLOCK comments the close is NOT nested - i.e. "first one wins")

Either way, there is risk that a bug in SQL might mean that a Sproc ONLY stored in the database might become un-retrievable, but personally I couldn't imagine editing them by RightClick anyway, some other colleague could RightClick edit at the same time and last-one-wins would mean one of us lost all our changes.

Another point: run DEV databases using FULL Recover Model. The fact that the data is of no consequence is less of an issue than "what was the source code of XXX 5 minutes ago" we used to run our DEV databases in SIMPLE until the first time we had a proper SNAFU event
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-12-31 : 08:47:44
It won't be irretrievable, even with block comments. It's SSMS that's got the bug, you can always pull the definition out of the system tables yourself if SSMS throws errors and you have no other copies.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-31 : 10:01:41
Yes, true, although I have struggled with that when lines are longer than 512 characters (or whatever the WRAP point is) - i.e. using sp_helptext. It only requires a bit of hand editing to sort it out, but its enough of a PITA that I am happier to have copy in external Revision Control system. I dunno why scripting an Sproc doesn't suffer from that problem, and sp_helptext does - would be nice if sp_helptext sorted it all out the same as Scripting it
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-12-31 : 10:56:45
So don't use sp_helptext, I haven't used that for anything other than quick examinations of code for ages. Use the base table, no wrapping at all.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-31 : 10:58:28
Oh! OK, I'd better take a look at that. Thanks. Wonder why sp_helptext hasn't been "updated" to do likewise ... Ho!Hum! mine not to reason why.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-31 : 11:57:39
OK, slight snag ... Query Analyser and SSMS have a limit of 8,000 characters per column for a SELECT query - is there a workaround for that?

Create test Sproc: (beware of line wrapping here, didn't want to make a monster-wide post)

DROP PROCEDURE Kristen_SP_LongLineTest
GO
CREATE PROCEDURE Kristen_SP_LongLineTest
AS
SELECT [Test] = 1
-- LongLine1 .!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 9000
-- LongLine2 .!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....!. 900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 1900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 2900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 3900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 4900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 5900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 6900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 7900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8000....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8100....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8200....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8300....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8400....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8500....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8600....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8700....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8800....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 8900....!....1....!....2....!....3....!....4....!....5....!....6....!....7....!....8....!....9....! 9000
GO

Methods to retrieve it:

EXEC sp_helptext 'sp_helptext'

SELECT [text]
FROM sys.objects AS O
JOIN sys.syscomments AS C
ON C.id = O.object_id
WHERE O.name = 'Kristen_SP_LongLineTest'
--
ORDER BY C.id, C.number, C.colid

SELECT M.definition
FROM sys.objects AS O
JOIN sys.sql_modules AS M
ON M.object_id = O.object_id
WHERE O.name = 'Kristen_SP_LongLineTest'
--
ORDER BY O.object_id


EDIT: That didn't work, without spaces Snitz puts it all on one line. I've modified it and put some spaces in the "longlines".
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-12-31 : 14:00:39
Hmmm... I forgot about that.

I have done that before, can't remember how.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-12-31 : 14:04:08
Btw, while SSMS breaks trying to script that example proc of yours, SQLPrompt retrieves it successfully (albeit without the comments)

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-31 : 18:30:04
I can run the code in my application (which can programmatically handle any size of column) - just not quite so convenient as using QA / SSMS.

Perhaps OSQL or somesuch won't care about column width?
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-01-01 : 10:09:40
Probably was.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
    Next Page

- Advertisement -