Tech-Today
How to alter bit and date column's default value in MSSQL
Aside from using the SQL Designer, you can alter a bit and date column's default value.
ALTER TABLE TableName ADD CONSTRAINT TableName_Disabled DEFAULT 0 FOR Disabled
ALTER TABLE TableName ADD CONSTRAINT TableName_DateCreated DEFAULT getdate() FOR DateCreated
To list the constraints created you can invoke:
EXEC sp_help TableName
-
Database
MSSQLMSSQL equivalent of DESC in MYSQLPostgresqlChange postgresql's postgres passwordHow to install hstore in postgresql 9.1JDBC provider setting in java for postgresql, mysql and oracleHow to alter the sequence value in postgresqlOracleHow to change...
-
Passing An Array Of Objects To Mssql Stored Procedure
Oftentimes you need to pass an array of objects (could be ids, types, etc) in an mssql stored procedure that you either need to insert into a table or use as filter. The following codes will explain the latter: Pass an array of integers: ALTER PROCEDURE...
-
Moving Data From A Table In One Database Into Another With The Same Table Definition
Objective: Given the same schema of database for example an active and archive, how should we move rows of data from one table in one database into the same table name in another database. Below is a java code snippet/pseudocode that I've created:...
-
Magento: Cannot Add Or Update A Child Row: A Foreign Key Constraint Fails
I am in the stage of migrating my local database of magento to public when I have encountered this error. How did it happen: 1.) I use phpmyadmin3.2 to export the sql statements. 2.) In my host mysql's phpmyadmin, I have executed the dump statements....
-
Mssql Equivalent Of Desc In Mysql
Long time ago I was executing the command that I'm so used to in mysql which is: desc tablename This command will give you the rows, its datatype, length, description etc. I've tried executing this in MSSQL and it's not working tried: describe,...
Tech-Today