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
 General SQL Server Forums
 New to SQL Server Programming
 Routine_Definition

Author  Topic 

tmaiden
Yak Posting Veteran

86 Posts

Posted - 2010-06-25 : 10:34:59
In SQL 2005 the Routine_Definition field within INFORMATION_SCHEMA.ROUTINES is a VARCHAR(4000). Is there anyway to change this field to NVARCHAR(MAX).

Thanks

Sachin.Nand

2937 Posts

Posted - 2010-06-25 : 10:45:16
I dont think you can do that.


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

tmaiden
Yak Posting Veteran

86 Posts

Posted - 2010-06-25 : 10:50:32
Is there anyway that I can script the backup of a stored procedure? I want to copy a stored procedure from one db to another without having to manually run the create script.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-25 : 11:00:15
Use

select object_definition(object_id('procedure'))

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

tmaiden
Yak Posting Veteran

86 Posts

Posted - 2010-06-25 : 11:12:49
quote:
Originally posted by madhivanan

Use

select object_definition(object_id('procedure'))

Madhivanan

Failing to plan is Planning to fail



Thank you. Is it possible for me to also do this?
SELECT OBJECT_DEFINITION(OBJECT_ID(SPECIFIC_NAME))
FROM INFORMATION_SCHEMA.ROUTINES
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-25 : 11:19:07
quote:
Originally posted by tmaiden

quote:
Originally posted by madhivanan

Use

select object_definition(object_id('procedure'))

Madhivanan

Failing to plan is Planning to fail



Thank you. Is it possible for me to also do this?
SELECT OBJECT_DEFINITION(OBJECT_ID(SPECIFIC_NAME))
FROM INFORMATION_SCHEMA.ROUTINES


Yes. Possible

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

tmaiden
Yak Posting Veteran

86 Posts

Posted - 2010-06-25 : 11:41:09
Is this more correct and am I missing anything else?

SELECT OBJECT_DEFINITION(OBJECT_ID(SPECIFIC_SCHEMA + '.' + SPECIFIC_NAME))
Go to Top of Page

tmaiden
Yak Posting Veteran

86 Posts

Posted - 2010-06-25 : 11:43:36
Also is it better to use SPECIFIC_ as apposed to ROUTINE_?
Go to Top of Page

sabra
Starting Member

25 Posts

Posted - 2010-06-25 : 12:19:26
How to create one simple SQL 2005 programm?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-28 : 02:33:25
quote:
Originally posted by sabra

How to create one simple SQL 2005 programm?


What did you mean by a program?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

sabra
Starting Member

25 Posts

Posted - 2010-07-01 : 04:29:51
I mean connection Database sql Server 2005 in to one program?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-07-01 : 04:46:14
quote:
Originally posted by sabra

I mean connection Database sql Server 2005 in to one program?


www.connectionstrings.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -