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.
| Author |
Topic |
|
CSantos
Starting Member
7 Posts |
Posted - 2002-08-23 : 11:05:32
|
| How can I Run a Transact SQL Script in a JOB with more that 3200 Characteres???Can I call a Script.SQL inside the JOB ???Thanks by your time. |
|
|
Kevin Snow
Posting Yak Master
149 Posts |
Posted - 2002-08-23 : 11:16:35
|
| Make the TSQL script into a stored procedure. Then call the stored procedure from inside the COMMAND text area.ie. paste TSQL script in a new procedure called MYPROCthen in the command text area of the JOB's STEP, enter exec MYPROCAlthough the command text area is limited to @3200 characters, the stored procedures are not. |
 |
|
|
CSantos
Starting Member
7 Posts |
Posted - 2002-08-23 : 11:24:13
|
| Kevin, Thank you for responding. |
 |
|
|
CSantos
Starting Member
7 Posts |
Posted - 2002-08-23 : 11:31:12
|
| Now I have another problem, how can I access 2 Databases in the same procedure ???Thanks by your time. |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-08-23 : 12:15:07
|
| SQL has a multi-part naming structure to allow this to happen...basically SELECT * from a.b.c.dwhere a is servername, b is databaseownername, c is databasename and d is tablename(not sure if b,c are reversed....check BOL for exact details....) |
 |
|
|
joshb
Yak Posting Veteran
52 Posts |
Posted - 2002-08-23 : 12:28:17
|
| Andrew is right, it goes: [server].[database].[object owner].[object] |
 |
|
|
CSantos
Starting Member
7 Posts |
Posted - 2002-08-23 : 12:30:46
|
| Andrew, JoshThanks by your time. |
 |
|
|
|
|
|