MODIFY COLUMN in oracle – How to check if a column is nullable before setting to nullable?

You could do this in PL/SQL: declare l_nullable user_tab_columns.nullable%type; begin select nullable into l_nullable from user_tab_columns where table_name=”MYTABLE” and column_name=”MYCOLUMN”; if l_nullable=”N” then execute immediate ‘alter table mytable modify (mycolumn null)’; end if; end;

Import and export schema in cassandra

To export keyspace schema: cqlsh -e “DESC KEYSPACE user” > user_schema.cql To export entire database schema: cqlsh -e “DESC SCHEMA” > db_schema.cql To import schema open terminal at ‘user_schema.cql’ (‘db_schema.cql’) location (or you can specify the full path) and open cqlsh shell. Then use the following command to import keyspace schema: source ‘user_schema.cql’ To import … Read more

TSQL Define Temp Table (or table variable) Without Defining Schema?

Actually using a table VARIABLE, an in-memory table, is the optimal way to go. The #table creates a table in temp db, and ##table is global – both with disk hits. Consider the slow-down/hit experienced with the number of transactions. CREATE PROCEDURE [dbo].[GetAccounts] @AccountID BIGINT, @Result INT OUT, @ErrorMessage VARCHAR(255) OUT AS BEGIN SET NOCOUNT … Read more

What is the use of mongoose methods and statics?

Database logic should be encapsulated within the data model. Mongoose provides 2 ways of doing this, methods and statics. Methods adds an instance method to documents whereas Statics adds static “class” methods to the Models itself. Given the example Animal Model below: var AnimalSchema = mongoose.Schema({ name: String, type: String, hasTail: Boolean }); module.exports = … Read more

where to find xsd.exe in visual studio 2013 on windows 8

Once you have the SDK installed * (either Manually, or with Visual Studio), you’ll find it in the following directories: SDK 8 and later There is an an additional FX version subdirectory: %programfiles(x86)%\Microsoft SDKs\Windows\{ver}\bin\{FXVer} Tools Where {ver} is the SDK version (e.g. v8.1A) and {FXVer} is the applicable .Net Framework version, e.g. NETFX 4.0v e.g. … Read more

Is there a performance decrease if there are too many columns in a table?

I don’t agree with all these posts saying 30 columns smells like bad code. If you’ve never worked on a system that had an entity that had 30+ legitimate attributes, then you probably don’t have much experience. The answer provided by HLGEM is actually the best one of the bunch. I particularly like his question … Read more