Copy an existing MySQL table to a new table
http://www.tech-recipes.com/rx/1487/copy-an-existing-mysql-table-to-a-new-table/
CREATE TABLE recipes_new LIKE production.recipes;
INSERT recipes_new SELECT * FROM production.recipes;
SHOW [GLOBAL | SESSION] VARIABLES
[LIKE 'pattern' | WHERE expr]
<binding name="basicHttpsBinding" maxReceivedMessageSize="524288000" />
<binding name="mexHttpBinding" maxReceivedMessageSize="524288000" />
</basicHttpBinding>
</bindings>
<service behaviorConfiguration="ServicioCCMasAvalBehavior" name="ServicioCCMasAval.ServicioCCMasAval">
<endpoint address="/" binding="basicHttpBinding" contract="ServicioCCMasAval.IServicioCCMasAval" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
I was missing the bindingConfiguration on the enpoint. Now this is my working webconfig:
<binding name="basicHttpBinding" maxReceivedMessageSize="524288000" />
<binding name="mexHttpBinding" maxReceivedMessageSize="524288000" />
</basicHttpBinding>
</bindings>
<service behaviorConfiguration="ServicioCCMasAvalBehavior" name="ServicioCCMasAval.ServicioCCMasAval">
<endpoint address="/" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" contract="ServicioCCMasAval.IServicioCCMasAval" />
</service>
</services>
If you want to disable all constraints in the database just run this code:
To switch them back on, run: (the print is optional of course and it is just listing the tables)
I find it useful when populating data from one database to another. It is much better approach than dropping constraints. As you mentioned it comes handy when dropping all the data in the database and repopulating it (say in test environment).
If you are deleting all the data you may find this solution to be helpful.
|
DBCC SHRINKDATABASE (dbName)DBCC SHRINKFILE (logicalLogFileName)USE dbName
EXEC sp_helpfile/* Shrink Whole AdventureWorks Database */
DBCC SHRINKDATABASE (AdventureWorks)
GO
/* Get the Logical File Name */
USE AdventureWorks
EXEC sp_helpfile
GO
/* Shrink MDF File of AdventureWorks Database */
DBCC SHRINKFILE (AdventureWorks_Data)
GOWindows+XPrograms and Features (first item on list)Turn Windows Features on or off on the left.NET Framework 4.5 Advanced ServicesWCF ServicesHTTP ActivationREM install the needed Windows IIS features for WCF
dism /Online /Enable-Feature /FeatureName:WAS-WindowsActivationService
dism /Online /Enable-Feature /FeatureName:WAS-ProcessModel
dism /Online /Enable-Feature /FeatureName:WAS-NetFxEnvironment
dism /Online /Enable-Feature /FeatureName:WAS-ConfigurationAPI
dism /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation
dism /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation45
REM Feature Install Complete
pause