How could I hide Redgate sql compare licenced serial number at console execution? - database-project

How could I hide sql compare licenced serial number at console command execution?
Command:
"C:\Program Files (x86)\Red Gate\SQL Compare 11\SQLCompare.exe" /project:aaa.scp" /filter:"bbb.scpf" /scriptfile:"ccc.sql" /force /report:"ddd.xml"
Output logs..
SQL Compare: activated, edition: professional, serial number: xxxxxxxxxxxxxxxxxx
SQL Compare Command Line V11.5.2.509
==============================================================================
Copyright Copyright � 1999 - 2016 Red Gate Software Ltd
Registering data sources
Creating mappings
Comparing
Summarizing Project Selections
Retrieving migration scripts
Generating report
Checking for identical databases
Creating SQL
Saving SQL

I'm using Mask Passwords Plugin with Jenkins. So I integrated this to Jenkins. Problem solved for me.
https://wiki.jenkins-ci.org/display/JENKINS/Mask+Passwords+Plugin

Related

Transfer database from SQL Server 2008 version 10.50.2500 to 10.0 2531

I cannot believe this is so difficult. Backup / Restore fails. Import and Export both fail with a variety of silly errors.
Is there a way to do this that works?
Try scripting out the schema and data, with the SQL Server Management Studio
Article explaining how to use SQL Server Management Studio
If that doesn't work, you'll have to use a more advanced third party tool. Like, for instance, Red Gate's Sql Toolbelt, where:
SQL Compare allows you to compare and merge schema between 2 databases
Data Compare allows you to compare and merge data between 2 databases

Visual Studio Data Compare Msg 3727

I tried to do data compare with Visual Studio 2012 but got 1 critical error. I was able to to do the comparison between these 2 db before I was forced to update the data compare since I am comparing with another db using SQL 2014. My latest SQL Server Data Tools ver is 11.1.40403.0
Please see below for the screen shot. Has anybody encounter this before and has solution? I am stuck as data compare doesn't has any option to select to bypass constraint check or whatsoever.
Problem is solved automatically after restart PC.

SQL Server 2012 \ VS 2010 - SQL syntax highlighting for custom file extensions

At work we have a variety of file extensions for our SQL code: .PRC for store procedures, .TAB for table scripts etc etc.
In previous versions of SQL Server Management Studio I could set each extension to use SQL syntax highlighting in the Tools > Options > Text Editor > File Extension menu.
But in SQL Server 2012 the option for "SQL Query Editor" is gone:
Anyone know of a work around, I've tried some registry hacks to no avail)
I added a * as a file extension that is handled by the SQL Query Editor and now I have the "SQL Query Editor" option in the drop down list of available editors. The reg key I edited was:
HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management
Studio\11.0_Config\Editors{B5A506EB-11BE-4782-9A18-21265C2CA0B4}\Extensions
I matched the DWORD value to that of the "sql" extension.
EDIT:
It looks like this only worked for the session life of SMSS. When I closed and reopened SMSS, the PRC mapping was erased and the DWORD key that I created was removed. Hopefully I can find a way to keep it persistant.

Why can't I create a simple SQL Agent Job or find correct syntax?

This works perfectly in a SSMS 2008 query window:
use [HSS Maintenance]
exec HSS_Guest.[olap storedprocedure]
exec HSS_Guest.[MAKE OLAP_CUBE]
But when I build an Agent Job and then test by using "Start Job at Step..." it always fails.
I have tried Operating System (CmdExec) "Type" as well as T-SQL and even SSAS I believe.
Am I having a Syntax issue or not using the correct "Type"?
Using full rights on an Enterprise edition & Server 2008.
I have Googled this to death and do not believe that I can't just build this simply via the GUI.
Please show me how dumb I am!
Note - I have tried to generate the Script from the Job window and get an error that "There is no Action to be Scripted"
Edit the SQL Server Agent job that contains the step that has the SQL code you posted. Remove the "use [HSS Maintenance]" line and instead use the drop down menu on the step to choose this database.

SQL Server 2005 - Export table programmatically (run a .sql file to rebuild it)

I have a database with a table Customers that have some data
I have another database in the office that everything is the same, but my table Customers is empty
How can I create a sql file in SQL Server 2005 (T-SQL) that takes everything on the table Customers from the first database, creates a, let's say, buildcustomers.sql, I zip that file, copy it across the network, execute it in my SQL Server and voila! my table Customers is full
How can I do the same for a whole database?
This functionality is already built in to Sql Server Management Studio 2008.
Just download the trial and only install the client tools (which shouldn't expire). Use Management Studio 2008 to connect to your 2005 database (its backwards compatible).
Right click your database
Choose Tasks > Generate Scripts
Press Next, select your database again
On the 'Choose Script Options' screen, there is an option called Script Data which will generate SQL insert statements for all your data.
(Note: for SQL Server Management Studio 2008 R2, the option is called "Types of data to script" and is the last one in the General section. The choices are "data only", "schema and data", and "schema only")
Use bcp (from the command line) to a networked file and then restore it.
e.g.
bcp "SELECT * FROM CustomerTable" queryout "c:\temp\CustomerTable.bcp"
-N -S SOURCESERVERNAME -T
bcp TargetDatabaseTable in "c:\temp\CustomerTable.bcp" -N -S TARGETSERVERNAME -T
-N use native types
-T use the trusted connection
-S ServerName
Very quick and easy to embed within code. (I've built a database backup(restore) system around this very command.
You can check the following article to see how you can do this by using both SQL Server native tools and the third party tools: SQL Server bulk copy and bulk import and export techniques
Disclaimer: I work for ApexSQL as a Support Engineer
Hope this helps
You could always export the data from the Customers table to an Excel file and import that data into your Customers table.
To import/export data:
Right click on database
Go to Tasks
Go to Import Data or Export Data
Change the data source to Microsoft Excel
Follow the wizard
If both databases resides in the same instance of SQL Server, ie use same connection, this SQL might be helpful:
INSERT INTO [DestinationDB].[schema].[table] ([column])
SELECT [column] FROM [OriginDB].[schema].[table]
GO
For Data Expoer as SQL script in SQL server 2005,
http://blog.sqlauthority.com/2007/11/16/sql-server-2005-generate-script-with-data-from-database-database-publishing-wizard/
I just like to add some screen shoots for Sql Server Management Studio 2008. It is correct to use the steps describe previously. When you have the 'Generate and Publish Script' -> 'Set Script Options' then press Advance to see script options:
![Where to find Advanced script options]: image missing because I do not have the right reputation :(
For Sql Server Management Studio 2008 the option to included data is 'Types of data to script'
![Types of data to script]: image missing because I do not have the right reputation :(