Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Wednesday, March 21, 2012

Encrypting the DTEXECUI command

Hi,
I am trying to find a feature- that was there in DTS but I can't locate it in SSIS

Using DTSRUNUI, we could generate a encrypted command line for executing the pacakge. Now using DTEXECUI, I can get the command line but is there any way in which I can get it in the encryted format?

Thanks.

DTEXEC and DTEXECUI have not support for encryption as did their DTS predecessors. This option is just not there. It wasn't very secure anyway, and could be cracked, but if you really want it back look you could always post a suggestion on MS Connect.

Whilst it was easy, there are some more secure ways of doing this, such as package encryption, or just securing the command line better in the first place.

|||

Thanks for the info.

Sunday, March 11, 2012

Encrypt SQL Command to any SQL Server

Hi,
I'm a developer and in my applications I send commands to the SQL Server
databases to create, or recreate, Stored Procedures, Functions and Triggers.
Recently I realize that my clients, using SQL Profiler, could see the code
of that functions, SPs and Triggers, and even change it after they know it.
This means that my intellectual property is not safe, and the clients has
access to my source code.
I want to know if there is same way to encrypt the commands that I send to
any SQL Server database in order to not being seen at profiler, at least for
that kind of commands.
I notice that profiler automatically not show commands like sp_addlogin
stored procedures...
Thanks for your help,
Pedro GonalvesYou can encrypt the communications between you application and the server wi
th the use of SSL.
Several sources of information exists on using SSL with SQL Server:
Configuring SSL on Servers
http://www.microsoft.com/resources/..._certsetssl.asp
7 Steps to SSL Encryption
http://www.winnetmag.com/SQLServer/...6908/26908.html
HOW TO: Enable SSL Encryption for SQL Server 2000 with Certificate Server
http://support.microsoft.com/defaul...kb;en-us;276553
How To: Use SSL to Secure Communication with SQL Server 2000
http://msdn.microsoft.com/library/d.../>
NetHT19.asp
Are just a few to get you going on the subject.
Randy Dyess
www.Database-Security.Info|||Hi Randy,
Yes. It's a way. But the problem is that I can't control my clients SQL
servers. This is a way to encrypt comunications with YOURS database server.
As I sell aplications, that my clients install in their servers, I simply
can't do it. And even with SSL, I think that Profiler can access to the
t-sql commands.
I just want to garantee that several commands, the source code commands like
stored procedures and trigger, that my application send to the database to
create functionality, aren't seen by the client.
Have you an ideia for this?
"Randy Dyess" <anonymous@.discussions.microsoft.com> wrote in message
news:A9A67657-6E3D-4E9E-A281-18561C51A8E4@.microsoft.com...
> You can encrypt the communications between you application and the server
with the use of SSL.
> Several sources of information exists on using SSL with SQL Server:
> Configuring SSL on Servers
>
http://www.microsoft.com/resources/...ssl.asp

> 7 Steps to SSL Encryption
> http://www.winnetmag.com/SQLServer/...6908/26908.html
> HOW TO: Enable SSL Encryption for SQL Server 2000 with Certificate Server
> http://support.microsoft.com/defaul...kb;en-us;276553
> How To: Use SSL to Secure Communication with SQL Server 2000
>

> Are just a few to get you going on the subject.
> Randy Dyess
> [url]www.Database-Security.Info" target="_blank">http://msdn.microsoft.com/library/d...e-Security.Info
>|||To add to the other responses, SQL Profiler will hide text that contains
sensitive commands like 'sp_password'. Consequently, you can include a
comment with this text in the batches you want to hide like the example
below.
Note that object text encryption is basically just obfuscation. A
determined user could reverse engineer the object to view the source. To
protect your intellectual property, you should explicitly state in your
license agreement that reverse engineering of your application code,
including SQL objects, is prohibited.
CREATE PROC usp_EncryptedProcedure1
WITH ENCRYPTION
AS
--sp_password
SELECT 'this create will not appear in profiler'
GO
CREATE PROC usp_EncryptedProcedure2
WITH ENCRYPTION
AS
SELECT 'this create will appear in profiler'
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Pedro Gonalves" <anonymous@.microsoft.com> wrote in message
news:%23ZRLGYu$DHA.2336@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I'm a developer and in my applications I send commands to the SQL Server
> databases to create, or recreate, Stored Procedures, Functions and
Triggers.
> Recently I realize that my clients, using SQL Profiler, could see the code
> of that functions, SPs and Triggers, and even change it after they know
it.
> This means that my intellectual property is not safe, and the clients has
> access to my source code.
> I want to know if there is same way to encrypt the commands that I send to
> any SQL Server database in order to not being seen at profiler, at least
for
> that kind of commands.
> I notice that profiler automatically not show commands like sp_addlogin
> stored procedures...
> Thanks for your help,
> Pedro Gonalves
>|||Just a small addition - if you really need good encryption of your objects,
onsider using a 3rd party tool like
http://www.ecatenate.com/dblockdown_product_info.html.
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:uLnYMm5$DHA.2448@.TK2MSFTNGP12.phx.gbl...
> To add to the other responses, SQL Profiler will hide text that contains
> sensitive commands like 'sp_password'. Consequently, you can include a
> comment with this text in the batches you want to hide like the example
> below.
> Note that object text encryption is basically just obfuscation. A
> determined user could reverse engineer the object to view the source. To
> protect your intellectual property, you should explicitly state in your
> license agreement that reverse engineering of your application code,
> including SQL objects, is prohibited.
>
> CREATE PROC usp_EncryptedProcedure1
> WITH ENCRYPTION
> AS
> --sp_password
> SELECT 'this create will not appear in profiler'
> GO
> CREATE PROC usp_EncryptedProcedure2
> WITH ENCRYPTION
> AS
> SELECT 'this create will appear in profiler'
> GO
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Pedro Gonalves" <anonymous@.microsoft.com> wrote in message
> news:%23ZRLGYu$DHA.2336@.TK2MSFTNGP11.phx.gbl...
> Triggers.
code
> it.
has
to
> for
>|||Thanks Dan, this is what I needed.
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:uLnYMm5$DHA.2448@.TK2MSFTNGP12.phx.gbl...
> To add to the other responses, SQL Profiler will hide text that contains
> sensitive commands like 'sp_password'. Consequently, you can include a
> comment with this text in the batches you want to hide like the example
> below.
> Note that object text encryption is basically just obfuscation. A
> determined user could reverse engineer the object to view the source. To
> protect your intellectual property, you should explicitly state in your
> license agreement that reverse engineering of your application code,
> including SQL objects, is prohibited.
>
> CREATE PROC usp_EncryptedProcedure1
> WITH ENCRYPTION
> AS
> --sp_password
> SELECT 'this create will not appear in profiler'
> GO
> CREATE PROC usp_EncryptedProcedure2
> WITH ENCRYPTION
> AS
> SELECT 'this create will appear in profiler'
> GO
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Pedro Gonalves" <anonymous@.microsoft.com> wrote in message
> news:%23ZRLGYu$DHA.2336@.TK2MSFTNGP11.phx.gbl...
> Triggers.
code
> it.
has
to
> for
>|||Pedro,
There is no good solution I'm afraid. Anything you encrypt there are ways o
f
decrpyting. If you want to protect your work/ideas/code then do that with a
legally binding agreement that customers have to sign.
Neil Pike MVP/MCSE. Protech Computing Ltd
Reply here - no email
SQL FAQ (484 entries) see
http://forumsb.compuserve.com/gvfor...p?SRV=MSDevApps
(faqxxx.zip in lib 7)
or www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
or www.sqlserverfaq.com
or www.mssqlserver.com/faq|||The next version of SQL Shield (www.sql-shield.com) will include protection
from the profiler. Currently this program protects stored procedures from
decryption by cracking tools.

Wednesday, March 7, 2012

Enabling SQL Server Agent by using scripts

Hi NG,
how do I have to enable the SQL Server Agent by using command line scripts
(without the Enterprise Manager). According to SQLServer books online the
command line command sqlagent should only be used for diagnostic purposes.
thanks for help, reneRene,
To start SQL Server Agent from the commandline you can do this:
net start sqlserveragent
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Re Fo wrote:
> Hi NG,
> how do I have to enable the SQL Server Agent by using command line scripts
> (without the Enterprise Manager). According to SQLServer books online the
> command line command sqlagent should only be used for diagnostic purposes.
> thanks for help, rene
>|||Thanks,
can I set it somewhere in the registry that the service will alwyas be
started, as I can set it in the Services properties?
Thanks for help, rene
"Mark Allison" <marka@.no.tinned.meat.mvps.org> wrote in message
news:ec0Gbwf4EHA.1976@.TK2MSFTNGP09.phx.gbl...
> Rene,
> To start SQL Server Agent from the commandline you can do this:
> net start sqlserveragent
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602m.html
>
> Re Fo wrote:
> > Hi NG,
> >
> > how do I have to enable the SQL Server Agent by using command line
scripts
> > (without the Enterprise Manager). According to SQLServer books online
the
> > command line command sqlagent should only be used for diagnostic
purposes.
> >
> > thanks for help, rene
> >
> >|||There are two places you can do this.
1)
Enterprise Manager-->General Tab, Tick AutoStart SQL Server Agent
2)
In Services Control Panel Applet, you can set the SQLServerAgent service
to AutoStart.
or if these don't work, you could even do this:
3)
CREATE PROC sp_startagent
AS
exec master..xp_cmdshell 'net start sqlserveragent', no_output
GO
exec sp_procoption N'sp_startagent', N'startup', N'true'
GO
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Re Fo wrote:
> Thanks,
> can I set it somewhere in the registry that the service will alwyas be
> started, as I can set it in the Services properties?
> Thanks for help, rene
> "Mark Allison" <marka@.no.tinned.meat.mvps.org> wrote in message
> news:ec0Gbwf4EHA.1976@.TK2MSFTNGP09.phx.gbl...
>>Rene,
>>To start SQL Server Agent from the commandline you can do this:
>>net start sqlserveragent
>>--
>>Mark Allison, SQL Server MVP
>>http://www.markallison.co.uk
>>Looking for a SQL Server replication book?
>>http://www.nwsu.com/0974973602m.html
>>
>>Re Fo wrote:
>>Hi NG,
>>how do I have to enable the SQL Server Agent by using command line
> scripts
>>(without the Enterprise Manager). According to SQLServer books online
> the
>>command line command sqlagent should only be used for diagnostic
> purposes.
>>thanks for help, rene
>>
>
>

Enabling SQL Server Agent by using scripts

Hi NG,
how do I have to enable the SQL Server Agent by using command line scripts
(without the Enterprise Manager). According to SQLServer books online the
command line command sqlagent should only be used for diagnostic purposes.
thanks for help, rene
Rene,
To start SQL Server Agent from the commandline you can do this:
net start sqlserveragent
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Re Fo wrote:
> Hi NG,
> how do I have to enable the SQL Server Agent by using command line scripts
> (without the Enterprise Manager). According to SQLServer books online the
> command line command sqlagent should only be used for diagnostic purposes.
> thanks for help, rene
>
|||Thanks,
can I set it somewhere in the registry that the service will alwyas be
started, as I can set it in the Services properties?
Thanks for help, rene
"Mark Allison" <marka@.no.tinned.meat.mvps.org> wrote in message
news:ec0Gbwf4EHA.1976@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Rene,
> To start SQL Server Agent from the commandline you can do this:
> net start sqlserveragent
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602m.html
>
> Re Fo wrote:
scripts[vbcol=seagreen]
the[vbcol=seagreen]
purposes.[vbcol=seagreen]
|||There are two places you can do this.
1)
Enterprise Manager-->General Tab, Tick AutoStart SQL Server Agent
2)
In Services Control Panel Applet, you can set the SQLServerAgent service
to AutoStart.
or if these don't work, you could even do this:
3)
CREATE PROC sp_startagent
AS
exec master..xp_cmdshell 'net start sqlserveragent', no_output
GO
exec sp_procoption N'sp_startagent', N'startup', N'true'
GO
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Re Fo wrote:
> Thanks,
> can I set it somewhere in the registry that the service will alwyas be
> started, as I can set it in the Services properties?
> Thanks for help, rene
> "Mark Allison" <marka@.no.tinned.meat.mvps.org> wrote in message
> news:ec0Gbwf4EHA.1976@.TK2MSFTNGP09.phx.gbl...
>
> scripts
>
> the
>
> purposes.
>
>

Sunday, February 19, 2012

enable a trigger

Hi!

I know that you can enable/disable a trigger through the alter
table command. Once a trigger is disabled, is there a way
to determine whether it is disabled or enabled? I see there is a
status column in sysobjects ...is that what I should be using?
thanks in advance for any help
KarenKaren (kjphipps_357@.hotmail.com) writes:
> I know that you can enable/disable a trigger through the alter
> table command. Once a trigger is disabled, is there a way
> to determine whether it is disabled or enabled? I see there is a
> status column in sysobjects ...is that what I should be using?
> thanks in advance for any help

No. You should use objectproperty(id, 'ExecTriggerIsDisabled')

Note: I typed property from memory. Look up objectproperty in Books
Online to verify that I got it right.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, February 17, 2012

Emptying Log file

Backup Log has Active and Inactive Portions. To Truncate Inactive
portion user the following command in SQL Query Analyser
USE The following Command
BACKUP LOG { database_name | @.database_name_var }
WITH TRUNCATE_ONLYThanx Rex
*** Sent via Developersdex http://www.examnotes.net ***

Wednesday, February 15, 2012

empty files to another files

Hi
Q1: I want to empty file into another file group. Is it possible?
Q2: What command does empty of the files. I do not see any command from
T-SQL doc but I may be wrong.
Q2: Is the table which are getting moved to another files are available for
transaction?
Thanks
Mangesh
Keep in mind that the primary file in the primary filegroup contains the
system table definitions and can not be moved. Moreover, no matter how many
other files or filegroups you have defined, the primary file can never be
removed from the database definition.
That being said, having multiple files within a filegroup will allow you to
mark any of these secondary files as EMPTYFILE and then have the data moved
to the remaining files within the same filegroup. To get the index data to
move, you could rebuild the indexes defined within the group or the
clustered index to move the data. You could also preform a database shrink
operation that would move data and index pages from one file to the others.
The only way to move index or data files from one filegroup to another, is
to rebuild the index(es) and define them to reside in the new filegroup.
This will only work on the user tables and indexes.
Sincerely,
Anthony Thomas

"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:F0A7AF64-0C5C-4AD8-BCAC-8C57B451B7F6@.microsoft.com...
Hi
Q1: I want to empty file into another file group. Is it possible?
Q2: What command does empty of the files. I do not see any command from
T-SQL doc but I may be wrong.
Q2: Is the table which are getting moved to another files are available for
transaction?
Thanks
Mangesh

empty files to another files

Hi
Q1: I want to empty file into another file group. Is it possible?
Q2: What command does empty of the files. I do not see any command from
T-SQL doc but I may be wrong.
Q2: Is the table which are getting moved to another files are available for
transaction?
Thanks
MangeshKeep in mind that the primary file in the primary filegroup contains the
system table definitions and can not be moved. Moreover, no matter how many
other files or filegroups you have defined, the primary file can never be
removed from the database definition.
That being said, having multiple files within a filegroup will allow you to
mark any of these secondary files as EMPTYFILE and then have the data moved
to the remaining files within the same filegroup. To get the index data to
move, you could rebuild the indexes defined within the group or the
clustered index to move the data. You could also preform a database shrink
operation that would move data and index pages from one file to the others.
The only way to move index or data files from one filegroup to another, is
to rebuild the index(es) and define them to reside in the new filegroup.
This will only work on the user tables and indexes.
Sincerely,
Anthony Thomas
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:F0A7AF64-0C5C-4AD8-BCAC-8C57B451B7F6@.microsoft.com...
Hi
Q1: I want to empty file into another file group. Is it possible?
Q2: What command does empty of the files. I do not see any command from
T-SQL doc but I may be wrong.
Q2: Is the table which are getting moved to another files are available for
transaction?
Thanks
Mangesh

empty files to another files

Hi
Q1: I want to empty file into another file group. Is it possible?
Q2: What command does empty of the files. I do not see any command from
T-SQL doc but I may be wrong.
Q2: Is the table which are getting moved to another files are available for
transaction?
Thanks
MangeshKeep in mind that the primary file in the primary filegroup contains the
system table definitions and can not be moved. Moreover, no matter how many
other files or filegroups you have defined, the primary file can never be
removed from the database definition.
That being said, having multiple files within a filegroup will allow you to
mark any of these secondary files as EMPTYFILE and then have the data moved
to the remaining files within the same filegroup. To get the index data to
move, you could rebuild the indexes defined within the group or the
clustered index to move the data. You could also preform a database shrink
operation that would move data and index pages from one file to the others.
The only way to move index or data files from one filegroup to another, is
to rebuild the index(es) and define them to reside in the new filegroup.
This will only work on the user tables and indexes.
Sincerely,
Anthony Thomas
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:F0A7AF64-0C5C-4AD8-BCAC-8C57B451B7F6@.microsoft.com...
Hi
Q1: I want to empty file into another file group. Is it possible?
Q2: What command does empty of the files. I do not see any command from
T-SQL doc but I may be wrong.
Q2: Is the table which are getting moved to another files are available for
transaction?
Thanks
Mangesh