Sys.sql_Module does not give full defination of store procedure

I want to get a defination of a store procedure by using sys.sql_Module
Beflow is the query i use 
SELECT  
@spTxt =ISNULL(smsp.definition, ssmsp.definition)) 
FROM sys.all_objects AS sp
LEFT OUTER JOIN sys.sql_modules AS smsp ON smsp.object_id = sp.object_id
LEFT OUTER JOIN sys.system_sql_modules AS ssmsp ON ssmsp.object_id = sp.object_id
WHERE (sp.type = N'P' OR sp.type = N'RF' OR sp.type='PC')and(sp.name=@SpName 
and SCHEMA_NAME(sp.schema_id)=@SchemaName)
@SchemaName = SCHEMA 
ANd @SpName = Store procedure Name.
This query does not give me complete store procedure.
Is there any other table i need to join and I can get full defination?
Thank you.
BM19.23

You're confusing what's being stored vs what's being displayed. The full proc is being stored in the definition column. It's just that SSMS won't display the full content of the cell.
The following is a proc that we use to overcome this situation... (I have no clue who the original author is)
CREATE PROCEDURE [dbo].[LongPrint]
@String NVARCHAR(MAX)
AS
Example:
exec LongPrint @string =
'This String
Exists to test
the system.'
/* This procedure is designed to overcome the limitation
in the SQL print command that causes it to truncate strings
longer than 8000 characters (4000 for nvarchar).
It will print the text passed to it in substrings smaller than 4000
characters. If there are carriage returns (CRs) or new lines (NLs in the text),
it will break up the substrings at the carriage returns and the
printed version will exactly reflect the string passed.
If there are insufficient line breaks in the text, it will
print it out in blocks of 4000 characters with an extra carriage
return at that point.
If it is passed a null value, it will do virtually nothing.
NOTE: This is substantially slower than a simple print, so should only be used
when actually needed.
DECLARE @CurrentEnd BIGINT, /* track the length of the next substring */
@offset TINYINT /*tracks the amount of offset needed */
SET @string = REPLACE( REPLACE(@string, CHAR(13) + CHAR(10), CHAR(10)) , CHAR(13), CHAR(10))
WHILE LEN(@String) > 1
BEGIN
IF CHARINDEX(CHAR(10), @String) BETWEEN 1 AND 4000
BEGIN
SET @CurrentEnd = CHARINDEX(CHAR(10), @String) -1
SET @offset = 2
END
ELSE
BEGIN
SET @CurrentEnd = 4000
SET @offset = 1
END
PRINT SUBSTRING(@String, 1, @CurrentEnd)
SET @string = SUBSTRING(@String, @CurrentEnd+@offset, 1073741822)
END /*End While loop*/
GO
To use the proc, you'd do something like this...
DECLARE @sql VARCHAR(MAX)
SELECT @sql = sm.definition FROM sys.sql_modules sm WHERE sm.object_id = 892230629
EXEC dbo.LongPrint @sql
HTH,
Jason
Jason Long

Similar Messages

  • Apple TV does not give acces to ITunes Store

    For the last week at least I have had problems accessing ITunes store from my Apple TV.
    I have updated the software, I have restarted my Apple Router I have access to Youtube - and I can enter via categories in movies and TV shows and where I can rent & Buy, I just cant get into the main pages - and popular movies.... WHY???

    Updating my question:
    I have now completed a Factory Restore, and a software update and still get the Message iTunes Store unavailable......,
    Except that I have found that If I go to Genres in either Films or Music it all appears to work OK, it is only when I try to access Top Films or Top Music that the store is unavailable.
    WHY???

  • My external LaCie drive gets an error message "the disc you inserted was not readable by this computer." The only options offered are "ignore" or "eject" Disk Utility sees the disc but does not give a repair option. What can I do?

    When I plug in my external LaCie drive I get an error message "the disc you inserted was not readable by this computer."
    The only options offered are "ignore" or "eject"
    Disk Utility sees the disc but does not give a repair option.
    What can I do?

    The good thing about mac-centric resellers such as OWC, is they have people on staff that can answer questions without you buying things first. They also have how-to information, and instructions are included in many of their products. I saw a link to watch a DIY video in one of their pages; an example of a RAID (with its own power supply) is shown on their drives page. Also a few in there, with no power supplies, for less money.
    If I were looking to backup and perhaps also have a partition for a system clone, I'd consider something like one of these: http://eshop.macsales.com/shop/firewire/1394/USB/EliteAL/eSATA_FW800_FW400_USB
    Some ideas on the RAID backup methods appear in google search, some of the pages are ideas and concepts; and the better ones also warn about using RAID for the only backup plan.
    Oh, OWC has live chat. Haven't tried it, nor have I bought anything from them. I have what appears to be two products from them, but have not used either. One is in a box as-new, but has only USB2.0 ports & my Macs needed FW400/800. It has been said their RAM is a good way to upgrade, too. But I can't confirm!
    A 'RAID-ready' unit for backup may be more versatile for just that, but I have not checked into these details. I use single HDDs in powered enclosures, and usually manually make backup clones to FW drives, of bootable OS X systems. Some of the OWC raid-ready use eSATA ports so that may not be viable for a computer without them.
    The unused in-box external drive I have is like the base model in the link above. However mine is USB2.0 (maybe) and won't boot my older Macs due to hardware variance; and my preference would be for FireWire options, these models do offer that. But the one I have does not. Dual 500GB HDDs, and they could be used in tandem as a RAID. That would be a choice set up in software. I'm not sure and not interested enough to read up just now.
    My backup method is not automatic, or a moving backup plan, if I don't get a move-on and make full system clones. I do make copies of photos and documents the manual way, to USB external drives; and occasionally backup to DVD or CD media. And USB flash, that helps to move files between computers without need to use file sharing via wi-fi. {Like Why fly? Walking is better exercise unless one is a bird. Squawk!}
    https://www.google.com/#q=raid+backup+mac
    Depending on the ports in your Mac, you may be able to use other cables to attach between a backup or externally enclosed hard disk drive with multiple partition and bootable clone in one of them. Not sure about the Thunderbolt, and where that is the main port, adapters are required to access other devices, as allowed.
    Anyway, I am going on and on, yet not really saying anything.
    My ideas would not be all that interesting to follow as a backup
    plan when matching available newer hardware to task, but you
    can get some into better ideas if you are not in a rush. Get a
    good setup and then look into more an betterer stuff.
    Good luck & happy computing!

  • SYS.UTL_FILE does not exists...

    Hi!
    I use 'utl_file.fopen' in a PL/SQL Package. It works fine with ORACLE 8.1.7 and now with ORALCE 9.2 it breaks.
    First I have create a directory 'UTL_FILE_TMP' and grant it to the PL/SQL user.
    At the code 'v_file := utl_file.fopen('UTL_FILE_TMP',v_name, 'a');' I get the ORAERR 04067 --> SYS.UTL_FILE does not exists...
    Have I install the package seperatly and when yes, how can I do?
    Regars
    -mic

    I really doubt that you have a directory called UTL_FILE_TMP, "C:\UTL_FILE_TMP" on a winows machine, "u01/UTL_FILE_TMP" on a unix machine I can believe, but a volume labeled "UTL_FILE_TMP", I don't You MUST have the full directory path the the directory and the directory MUST be writable by the user (typically oracle) that is running the database code.

  • HT1212 My iPad locked after 1 incorrect passcode entry and I tried what a senior advisor told my to do, but it could not download the info unless I entered the correct pass code, which I can not do since it does not give me the opportunity.

    My iPad locked after 1 incorrect passcode entry and I tried what a senior advisor told my to do, but it could not download the info unless I entered the correct pass code, which I can not do since it does not give me the opportunity.  How do I get the window to enter my pass code?

    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    Saw this solution on another post about an iPad in a school enviroment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • MY printer officejet7​000 DOES NOT PRINT FULL A3 SIZE PAPER LIKE my prin cut for botam

    MY printer officejet7000 DOES NOT PRINT FULL A3 SIZE PAPER my print cut for botam & top side, Same printout give in my old model printer like k7108  this printer printour full printing, but I newly purchase printer not printour full a3 size print

    Those '''user_pref("print.printer_Artisan_837 ....''' preferences are what needs to be deleted, with Firefox closed.
    I think that "ding-dong" error sound might be due to an old print job stuck in the print cache, though. Open the Windows Control Panel > Printers and Faxes and check the '''Status''' for that printer.

  • How do i delete songs from my iphone when they don't show up in itunes? Swiping across the song on the iphone does not give me a delete button.

    How do i delete songs from my iphone when they don't show up in itunes? Swiping across the song on the iphone does not give me a delete button.

    Hello audreywisc,
    Songs can be removed from your iPhone by tapping 'Songs,' then swiping the song, then tapping Delete.
    Remove a song from iPhone. Tap Songs, swipe the song, then tap Delete. The song is deleted from iPhone, but not from your iTunes library on your Mac or PC, or from iCloud.
    iPhone User Guide - Playlists
    http://help.apple.com/iphone/8/
    Cheers,
    Allen

  • How do I Restore my iPhoto library from my time machine if it does not give me the restore option?

    How do I Restore my iPhoto library from my time machine if it does not give me the restore option?
    When I go into my backups and click on the iPhoto library it does not come up with an option to restore it just says open and of course then won't let me open it because it is a back up in time machine? I need these photo very important.

    Mac Basics: Time Machine backs up your Mac - Apple Support
    For detailes TM support post in the forum for your OS rather than the iphoto forum
    LN

  • I am trying to authorise my new macbook air and it won't let me. I try to de-authorise all the other computers and it says I can only do this once a year and have to wait until the 7th Feb. It does not give me an option to authorise this computer

    I am trying to authorise my new macbook air for i-tunes and it won't let me. I try to de-authorise all the other computers and it says I can only do this once a year and have to wait until the 7th Feb. It does not give me an option to authorise this computer

    Always remember to 'de-authorize' you computer when selling or sending for service. If sending for repairs you might not get the same mother board or HD back and some how this counts as an authorized computer against your count.
    MJ

  • HT4009 I would like to make an in app purchase using my $20.00 credit that I have on I tunes. I am using my  i phone5. It does not give me the choice of using the credit that I have, only a credit card. How can I use the credit for the purchase??

    I would like to make an in app purchase using the $20.00 credit that I have on itunes. I am using my i phone5. It does not give me the option of using the credit that I already have, only of using a credit card. How can I use the credt that I already have instead of a credit card?

    Is Settings > General > Restrictions > In-App Purchases: ON (green)?
    Some In-App Purchases works only with credit card.

  • In my firefor options window I have two zipped folders one allows me to brows and see what is inside the other does not give me this option. how can I see what is inside please?

    I have had MyWebSearch install itself as my primary browser....I have needed to reset Firefox in safe mode but I am not sure that the changes have actually been done! In Options in the Options menu the window displays all the add on's and features that are on Firefox....I have two zipped folders here One allows me to see inside the other does not. How do I access this one that does not give me the option to as I want to know what is inside...as this "MyWebSearch has been an enormous hassle...and needless to say has compromised my PC and the security of all of my passwords.....I want to be sure that the resetting the browser default has actually worked and that MyWebSearch is gone!
    Regards
    Coco

    Are you talking about MyWebSearch toolbar (http://help.mywebsearch.com/sbar2.html#q1) which offers apps such as Smiley Central, Cursor Mania???
    If yes, uninstallation instructions are here - (http://help.mywebsearch.com/sbar2.html#q4). Could you provide me some details about the ZIP folders. If I get a screenshot, I can help you very well.

  • Error while executing webdynpro application : he URL does not contain full

    Dear All,
    I had installed SAP in my system.But when I am testing webdynpro application I am getting the belwo error. Please let me knwo what setting I need to do to avoid this error.
    Error when processing your request
    What has happened?
    The URL http://hari:8000/sap/bc/webdynpro/sap/z_test_pg was not called due to an error.
    Note
    The following error text was processed in the system DEV : The URL does not contain full domain specification (hari statt hari.<domain>.<ext>).
    The error occurred on the application server HARI_DEV_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: CHECK of program CX_FQDN=======================CP
    Method: LATE_CONSTRUCTOR of program CL_WDR_UCF====================CP
    Method: HANDLE_REQUEST of program CL_WDR_UCF====================CP
    Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
    Method: EXECUTE_REQUEST of program CL_HTTP_SERVER================CP
    Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
    Module: %_HTTP_START of program SAPMHTTP
    What can I do?
    If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system DEV in transaction ST22.
    If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server HARI_DEV_00 in transaction SM21.
    If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server HARI_DEV_00 . In some situations, you may also need to analyze the trace files of other work processes.
    If you do not yet have a user ID, contact your system administrator.
    Error code: ICF-IE-http -c: 800 -u: SAPUSER -l: E -s: DEV -i: HARI_DEV_00 -w: 0 -d: 20080109 -t: 073032 -v: RABAX_STATE -e: UNCAUGHT_EXCEPTION
    HTTP 500 - Internal Server Error
    Your SAP Internet Communication Framework Team

    Hello,
    Little extract from the SAP online help :
    In Web Dynpro ABAP it is imperative that a client browser with a fully qualified domain name (FQDN) has access to the AS-ABAP. For this reason the full URL must be assigned to a Web Dynpro ABAP application when it is called. The URL must not be shortened (for instance, no domain specification).
    More info on how you should do this can be found here :
    [Click|http://help.sap.com/saphelp_nw70/helpdata/en/67/be9442572e1231e10000000a1550b0/content.htm]
    This will solve your problem.
    Success.
    Wim

  • Hp officejet pro 8500 a910 does not give me the option of printing in black and white

    Hello,
    My hp officejet pro 8500 a910 does not give me the option of printing in black and white. How do I choose to print in B&W when the option does not show up under properties?
    Thank you.
    This question was solved.
    View Solution.

    Hi,
    From the application being used to print, Click File > Print
    Click Properties or Preferences to access the Printing Preferences Dialog.
    Click the Advanced button at the bottom of the window.
    Under Printer Features, Click the Print as Grayscale selection box and set as High Quality Grayscale or Black Ink Only.
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Netctl fails to connect to a wireless network and does not give detail

    If I try to connect to a wireless network (WEP, DHCP) using netctl I get "Jon for netctl@wlp2s0\x2dnetworkname.service failed." and two commands (journalctl -xn and systemctl status ...) that should give details about the error.
    However, both of them give the following lines:
    oct 05 14:44:25 laptop network[422]: Starting network profile 'wlp2s0-networkname'...
    oct 05 14:44:30 laptop network[422]: Failed to bring the network up for profile 'wlp2s0-networkname'
    oct 05 14:44:30 laptop systemd[1]: netctl@wlp2s0\x2dnetworkname.service: main process exited, code=exited, status=1/FAILURE
    oct 05 14:44:30 laptop systemd[1]: Failed to start Networking for netctl profile wlp2s0-networkname.
    oct 05 14:44:30 laptop systemd[1]: Unit netctl@wlp2s0\x2dnetworkname.service entered failed state.
    Just one line saying that it was trying to connect and four lines repeating the same thing (connecting failed), but it does not give any detail at all.
    The netctl profile is:
    Interface=wlp2s0
    Connection=wireless
    Security=wep
    ESSID=networkname
    IP=dhcp
    Key=\"hex-password
    Last edited by eduardosm (2014-10-05 14:01:02)

    MoonSwan wrote:Either this Key=\"hex-password was a typo when you cut & pasted that code or your issue is that you need a closing " symbol.  So your line should read:  Key=\"hex-password".
    If you look at the netctl.profile man page, it explains some special quoting rules at the end.  The literal double-quote (or escaped double-quote) actually just results in a non-quoted string when passed from netctl to the underlying supporting software.  This is apparently necessary if the WEP key is in hexadecimal.

  • I'm applying for jobs online through my iPad using the safari app. For some reason when I try to attach my resume, which I have saved in Pages, it does not give me an option to go to Pages. It only gives my an option to choose a file from photos. Does it

    I’m applying for jobs online through my iPad using the safari app. For
    some reason when I try to attach my resume, which I have saved in
    Pages, it does not give me an option to go to Pages. It only gives
    my an option to choose a file from photos. Does it not have the
    capability to choose a location other than photos??

    No. Safari does not have the option to attach files for uploading other than photos.
    Look at iCab Mobile in the App Store. There are other browsers that may do this, but I'm pretty sure that iCab will fill the need.
    iCab Mobile (Web Browser) on the App Store on iTunes
    take a look at this.
    http://www.icab-mobile.de/faq.html

Maybe you are looking for

  • I am tryign tor reorder photos ( in library mode) but warning mesage says cannot do  can anyone help?  thank you

    I am tryign tor reorder photos ( in library mode) but warning mesage says cannot do can anyone help? thank you

  • Fiber connection ???

    hope this is the right place ... i have changed broadband to EE fiber they have 2 options to connect with  2.4 ghz (B.G AND N ) and 5ghz ( N AND AC ) for a better faster performance both are available on mobile phones but not on my lenovo ideapadS405

  • TV shows and Movies won´t start, only loading and then nothing

    Suddenly TV Shows and Movies won´t start on my Apple TV. After purchasing, it starts to load and then nothing. It loads for a few minutes and it says it was "unsuccesfull". I have tried to restart the Apple TV and the WiFi. Please help!

  • Will not connect with AOL mail box

    Get all the way to opening individual e-mails...get message that Firefox is being directed to site that will never connect. Also will not sign-out from AOL...wait & wait & wait

  • Disk writes often

    Hello I Have the following hardware configuration 2 hard drives: /dev/hda with /dev/hda1 mounted as / /dev/hda2 mounted as /tmp /dev/hda3                      /home and /dev/hdb /dev/hdb2 swap kernel version is 2.6.18. The following problem appear, d