Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Friday, March 30, 2012

Scripting

I'm used to using Unix to do scripting. It's a pretty powerful scripting
language with some looping, conditions, text editing/modification, etc. Doe
s
DOS have all that built in as well? Is that you guys use to script? If so,
does it have looping, conditions, etc somewhat like Unix?CLM,
Try VBScript. SQL Server has the capability to used ActiveX scripts in DTS
packages and jobs.
For more information on VBScript see:
http://msdn.microsoft.com/library/d.../>
iptinga.asp
HTH
Jerry
"CLM" <CLM@.discussions.microsoft.com> wrote in message
news:0CCA63F8-34C0-40DE-A772-10A218F5F58A@.microsoft.com...
> I'm used to using Unix to do scripting. It's a pretty powerful scripting
> language with some looping, conditions, text editing/modification, etc.
> Does
> DOS have all that built in as well? Is that you guys use to script? If
> so,
> does it have looping, conditions, etc somewhat like Unix?|||One last question: can you execute it from the command line though?
"Jerry Spivey" wrote:

> CLM,
> Try VBScript. SQL Server has the capability to used ActiveX scripts in DT
S
> packages and jobs.
> For more information on VBScript see:
> http://msdn.microsoft.com/library/d...
criptinga.asp
> HTH
> Jerry
> "CLM" <CLM@.discussions.microsoft.com> wrote in message
> news:0CCA63F8-34C0-40DE-A772-10A218F5F58A@.microsoft.com...
>
>|||Yes use WScript or CScript (can be wrapped in .bat file as well).
HTH
Jerry
"CLM" <CLM@.discussions.microsoft.com> wrote in message
news:5653274C-128F-4D53-A024-14EC4434E831@.microsoft.com...[vbcol=seagreen]
> One last question: can you execute it from the command line though?
> "Jerry Spivey" wrote:
>|||Thx. That ought to keep me busy.
"Jerry Spivey" wrote:

> Yes use WScript or CScript (can be wrapped in .bat file as well).
> HTH
> Jerry
> "CLM" <CLM@.discussions.microsoft.com> wrote in message
> news:5653274C-128F-4D53-A024-14EC4434E831@.microsoft.com...
>
>|||You can use the CSCRIPT from command line to execute ActiveX Script / if you
are using DTS packages , you could use DTSWIZ
"CLM" wrote:
[vbcol=seagreen]
> One last question: can you execute it from the command line though?
> "Jerry Spivey" wrote:
>

Scripting

I'm used to using Unix to do scripting. It's a pretty powerful scripting
language with some looping, conditions, text editing/modification, etc. Does
DOS have all that built in as well? Is that you guys use to script? If so,
does it have looping, conditions, etc somewhat like Unix?CLM,
Try VBScript. SQL Server has the capability to used ActiveX scripts in DTS
packages and jobs.
For more information on VBScript see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/scriptinga.asp
HTH
Jerry
"CLM" <CLM@.discussions.microsoft.com> wrote in message
news:0CCA63F8-34C0-40DE-A772-10A218F5F58A@.microsoft.com...
> I'm used to using Unix to do scripting. It's a pretty powerful scripting
> language with some looping, conditions, text editing/modification, etc.
> Does
> DOS have all that built in as well? Is that you guys use to script? If
> so,
> does it have looping, conditions, etc somewhat like Unix?|||One last question: can you execute it from the command line though?
"Jerry Spivey" wrote:
> CLM,
> Try VBScript. SQL Server has the capability to used ActiveX scripts in DTS
> packages and jobs.
> For more information on VBScript see:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/scriptinga.asp
> HTH
> Jerry
> "CLM" <CLM@.discussions.microsoft.com> wrote in message
> news:0CCA63F8-34C0-40DE-A772-10A218F5F58A@.microsoft.com...
> > I'm used to using Unix to do scripting. It's a pretty powerful scripting
> > language with some looping, conditions, text editing/modification, etc.
> > Does
> > DOS have all that built in as well? Is that you guys use to script? If
> > so,
> > does it have looping, conditions, etc somewhat like Unix?
>
>|||Yes use WScript or CScript (can be wrapped in .bat file as well).
HTH
Jerry
"CLM" <CLM@.discussions.microsoft.com> wrote in message
news:5653274C-128F-4D53-A024-14EC4434E831@.microsoft.com...
> One last question: can you execute it from the command line though?
> "Jerry Spivey" wrote:
>> CLM,
>> Try VBScript. SQL Server has the capability to used ActiveX scripts in
>> DTS
>> packages and jobs.
>> For more information on VBScript see:
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/scriptinga.asp
>> HTH
>> Jerry
>> "CLM" <CLM@.discussions.microsoft.com> wrote in message
>> news:0CCA63F8-34C0-40DE-A772-10A218F5F58A@.microsoft.com...
>> > I'm used to using Unix to do scripting. It's a pretty powerful
>> > scripting
>> > language with some looping, conditions, text editing/modification, etc.
>> > Does
>> > DOS have all that built in as well? Is that you guys use to script?
>> > If
>> > so,
>> > does it have looping, conditions, etc somewhat like Unix?
>>|||Thx. That ought to keep me busy. :)
"Jerry Spivey" wrote:
> Yes use WScript or CScript (can be wrapped in .bat file as well).
> HTH
> Jerry
> "CLM" <CLM@.discussions.microsoft.com> wrote in message
> news:5653274C-128F-4D53-A024-14EC4434E831@.microsoft.com...
> > One last question: can you execute it from the command line though?
> >
> > "Jerry Spivey" wrote:
> >
> >> CLM,
> >>
> >> Try VBScript. SQL Server has the capability to used ActiveX scripts in
> >> DTS
> >> packages and jobs.
> >>
> >> For more information on VBScript see:
> >>
> >> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/scriptinga.asp
> >>
> >> HTH
> >>
> >> Jerry
> >> "CLM" <CLM@.discussions.microsoft.com> wrote in message
> >> news:0CCA63F8-34C0-40DE-A772-10A218F5F58A@.microsoft.com...
> >> > I'm used to using Unix to do scripting. It's a pretty powerful
> >> > scripting
> >> > language with some looping, conditions, text editing/modification, etc.
> >> > Does
> >> > DOS have all that built in as well? Is that you guys use to script?
> >> > If
> >> > so,
> >> > does it have looping, conditions, etc somewhat like Unix?
> >>
> >>
> >>
>
>|||You can use the CSCRIPT from command line to execute ActiveX Script / if you
are using DTS packages , you could use DTSWIZ
"CLM" wrote:
> One last question: can you execute it from the command line though?
> "Jerry Spivey" wrote:
> > CLM,
> >
> > Try VBScript. SQL Server has the capability to used ActiveX scripts in DTS
> > packages and jobs.
> >
> > For more information on VBScript see:
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/scriptinga.asp
> >
> > HTH
> >
> > Jerry
> > "CLM" <CLM@.discussions.microsoft.com> wrote in message
> > news:0CCA63F8-34C0-40DE-A772-10A218F5F58A@.microsoft.com...
> > > I'm used to using Unix to do scripting. It's a pretty powerful scripting
> > > language with some looping, conditions, text editing/modification, etc.
> > > Does
> > > DOS have all that built in as well? Is that you guys use to script? If
> > > so,
> > > does it have looping, conditions, etc somewhat like Unix?
> >
> >
> >sql

Tuesday, March 20, 2012

Script SQL 2005 database to individual files?

I am trying to script the DROP(IF EXISTS) and CREATE for all of my
tables, views, stored procs, and functions to individual SQL text files
(one per object). This was trivially done in SQL 2000 with Enterprise
Manager, but when I try in SQL 2005 through Management Studio my only
"script mode" options are:

- Script to file (which is one huge file with everything)
- Script to Clipboard
- Script to New Query Window

FYI, I get to this screen through Management Studio by right clicking
on a database and selecting Tasks > Generate Scripts... > Next (doesn't
seem to matter what combo of objects I select to script or what other
options). I am using SQL Server 2005 Developer (which is Microsoft SQL
Server Management Studio 9.00.1399.00).

Any solution to this (i.e. via Management Studio, command line, etc.)
would be greatly appreciated.

Thanks.
TedMSDN/BOL indicates that this is possible here
http://msdn2.microsoft.com/en-us/library/ms191299.aspx. However, it
doesn't give any clue on how to accomplish it.

Quote from that page: "The schema for generated objects can be saved in
a single SQL Script file, or in several files with each file containing
the schema of just one object."|||Ted O'Connor (toconnor@.gmail.com) writes:
> I am trying to script the DROP(IF EXISTS) and CREATE for all of my
> tables, views, stored procs, and functions to individual SQL text files
> (one per object). This was trivially done in SQL 2000 with Enterprise
> Manager, but when I try in SQL 2005 through Management Studio my only
> "script mode" options are:
> - Script to file (which is one huge file with everything)
> - Script to Clipboard
> - Script to New Query Window
> FYI, I get to this screen through Management Studio by right clicking
> on a database and selecting Tasks > Generate Scripts... > Next (doesn't
> seem to matter what combo of objects I select to script or what other
> options). I am using SQL Server 2005 Developer (which is Microsoft SQL
> Server Management Studio 9.00.1399.00).
> Any solution to this (i.e. via Management Studio, command line, etc.)
> would be greatly appreciated.

Rather than hackiong SMO on your own, I don't think there is one.
Note that there are really two features from SQL 2000 you are missing:
1) One object per file.
2) A script that performs both DROP and CREATE.

There is this suggestion on MSDN Product Feedback Centre,
http://lab.msdn.microsoft.com/produ...px?feedbackid=9
eb6c773-2dbb-4a27-b9d8-225d6ed4385a
the by far most voted-on item for SQL Server.

I did actually only find one item that brings up one file per object,
http://lab.msdn.microsoft.com/produ...px?feedbackid=2
7695db7-cef6-42c3-9cb0-ac30583bbee9
there are no votes here, beside the submitted, but that is because the
bug has not been validated.

In any case, that would be better as a suggestion, as it is not a bug
that you can't script per object, just a poor design. So if you can't
find a suggestion on that theme - submit one.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Monday, March 12, 2012

script in text in 2005 EM?

Hi,

In 2000 you could script out a file (tables SP's etc.) as text by going under Options -> File Options and choosing the MS-DOS text (OEM) format. I'm wondering where/if this same capability is in 2005. Right now, it looks like the default is binary. Can anybody share some information on this?

Thanks,

Phil

Using SSMS, in the Object Explorer, right click on the database, table, Progamable object, etc., and select [Script ... as]|||

That's only how to script an object. My question is how to script an object as text. If you notice when you script an object like the way you are suggesting, it will by a binary file (atleast when I check it into sourcesafe). This was an issue I had before in SQL 2000, but atleast it gave the option to script the file out to MS DOS (text). Does anyone else know what I'm referring to?

Thanks,

Phil

Wednesday, March 7, 2012

Script Component – “extremely long lines of text”

In all my SSIS packages where I have created a Script Component (destination) in my Data Flow and set the PreCompile option to True; the binary of the script is being put in the dtsx fileas a single line. Subsequently every time I try to open the package, Visual Studio warns me that: “Document contains one or more extremely long lines of text. These lines will cause the editor to respond slowly when you open the file. Do you still wish to open the file?”

Any idea how to fix this?

NOTE: This does not happen for any PreCompiled Script Tasks. For these the binary is broken into multiple lines in the dtsx file.

Thank you for your help,

-Tim

Tim,

Unfortunately this is a hangover from using the VS shell. There's nothing you can do about it.

-Jamie

|||Oddly enough, this bug is listed as "fixed" with a note from an SSIS team:

Resolved as Fixed by Microsoft on 2005-10-18 at 16:20:03
Thanks for your report, we're getting this message removed in a service pack.

Best regards,
Sergei Ivanov
Integration Services Development Team Resolved as Fixed by Microsoft on 2005-11-17 at 12:25:30
Thanks, this is fixed.

Sergei Ivanov
Integration Services Development Team


You can see the full bug report here on the MSDN Product Feedback Ctr. It's BUG ID: FDBK37397.
However, the KB Article for SP1 (KB913090) detailing the fixes seems to make no mention of it, at least none that I could find in a quick passthru. When I can find a machine to test the SP1 CTP, we'll see.
|||

Yes, this is fixed by SP1. AFAIK the KB is not the complete list of fixes.
There is a limitation with the fix though: you need to create new script component with SP1 build of SSIS. The script components created with RTM build still have this issue (this is done so that the precompiled script of these components can be read by RTM build of SSIS, otherwise we would break backward compatibility).

By the way, you don't need SP1 CTP, the final SP1 has been released.

|||I have a package with no script components yet I still get this error message each time I load it. Here is what I have discovered. When I set the ProtectionLevel property to EncryptAllWithPassword I get the error message. When I set the ProtectionLevel to EncryptSensitiveWithPassword the message no longer appears. Any Ideas why?|||

dgrm44 wrote:

I have a package with no script components yet I still get this error message each time I load it. Here is what I have discovered. When I set the ProtectionLevel property to EncryptAllWithPassword I get the error message. When I set the ProtectionLevel to EncryptSensitiveWithPassword the message no longer appears. Any Ideas why?

I would guess that the encrypted results in some rather long lines. AcryptAllWithPassword will result in more encryprion than EncryptSensitiveWithPassword.

Take a look at the contents of the .dtsx file and see if it becomes obviousl I would also guess that the size of the file differs quite a bit as well.

-Jamie

Script Component – “extremely long lines of text”

In all my SSIS packages where I have created a Script Component (destination) in my Data Flow and set the PreCompile option to True; the binary of the script is being put in the dtsx fileas a single line. Subsequently every time I try to open the package, Visual Studio warns me that: “Document contains one or more extremely long lines of text. These lines will cause the editor to respond slowly when you open the file. Do you still wish to open the file?”

Any idea how to fix this?

NOTE: This does not happen for any PreCompiled Script Tasks. For these the binary is broken into multiple lines in the dtsx file.

Thank you for your help,

-Tim

Tim,

Unfortunately this is a hangover from using the VS shell. There's nothing you can do about it.

-Jamie

|||Oddly enough, this bug is listed as "fixed" with a note from an SSIS team:

Resolved as Fixed by Microsoft on 2005-10-18 at 16:20:03
Thanks for your report, we're getting this message removed in a service pack.

Best regards,
Sergei Ivanov
Integration Services Development Team Resolved as Fixed by Microsoft on 2005-11-17 at 12:25:30
Thanks, this is fixed.

Sergei Ivanov
Integration Services Development Team


You can see the full bug report here on the MSDN Product Feedback Ctr. It's BUG ID: FDBK37397.
However, the KB Article for SP1 (KB913090) detailing the fixes seems to make no mention of it, at least none that I could find in a quick passthru. When I can find a machine to test the SP1 CTP, we'll see.
|||

Yes, this is fixed by SP1. AFAIK the KB is not the complete list of fixes.
There is a limitation with the fix though: you need to create new script component with SP1 build of SSIS. The script components created with RTM build still have this issue (this is done so that the precompiled script of these components can be read by RTM build of SSIS, otherwise we would break backward compatibility).

By the way, you don't need SP1 CTP, the final SP1 has been released.

|||I have a package with no script components yet I still get this error message each time I load it. Here is what I have discovered. When I set the ProtectionLevel property to EncryptAllWithPassword I get the error message. When I set the ProtectionLevel to EncryptSensitiveWithPassword the message no longer appears. Any Ideas why?|||

dgrm44 wrote:

I have a package with no script components yet I still get this error message each time I load it. Here is what I have discovered. When I set the ProtectionLevel property to EncryptAllWithPassword I get the error message. When I set the ProtectionLevel to EncryptSensitiveWithPassword the message no longer appears. Any Ideas why?

I would guess that the encrypted results in some rather long lines. AcryptAllWithPassword will result in more encryprion than EncryptSensitiveWithPassword.

Take a look at the contents of the .dtsx file and see if it becomes obviousl I would also guess that the size of the file differs quite a bit as well.

-Jamie