Show all keys in redis – in one line
You need to do redis-cli keys ‘*’ to avoid your shell from expanding * into a list of filenames.
You need to do redis-cli keys ‘*’ to avoid your shell from expanding * into a list of filenames.
Full text search is likely to be quicker since it will benefit from an index of words that it will use to look up the records, whereas using LIKE is going to need to full table scan. In some cases LIKE will more accurate since LIKE “%The%” AND LIKE “%Matrix” will pick out “The Matrix” … Read more
That isn’t quite an SQL file, that contains a bunch of MySQL-specific stuff some of which SQLite will accept and some it won’t. We’ll start at the top. You don’t need create database or use with SQLite. If you want to create a database just name it when you run sqlite3 from the command line: … Read more
Though this post is old but still I see many people not able to get real Auto Complete intellisense feature because as soon as Auto Complete values exceeds 10 then autocomplete doesn’t work i.e you need to explicitly use CTRL+SPACE for displaying intellisense in that case. Please follow the steps so that you will be … Read more
if you are trying to Clone your database on the same server try this: Create a backup of the database you want to copy right-click on Databases and select Restore Database Select the database you want to copy from the From Database drop-down list in the Source for restore section Enter the name of the … Read more
Install Entity Framework Power Tools Beta 4, restart Visual Studio, right-click on the context in your solution view and you’ll see a new ‘Entity Framework’ option in the context menu. Select ‘View Entity Data Model’ to see a beautiful visual database diagram in Visual Studio. VoilĂ ! Entity Framework 6 Power Tools: Link
Use alter table to add a new constraint: alter table foo add constraint check_positive check (the_column > 0); More details and examples are in the manual: http://www.postgresql.org/docs/current/static/sql-altertable.html#AEN70043 Edit Checking for specific values is done in the same way, by using an IN operator: alter table foo add constraint check_positive check (some_code in (‘A’,’B’));
You can use a deadlock graph and gather the information you require from the log file. The only other way I could suggest is digging through the information by using EXEC SP_LOCK (Soon to be deprecated), EXEC SP_WHO2 or the sys.dm_tran_locks table. SELECT L.request_session_id AS SPID, DB_NAME(L.resource_database_id) AS DatabaseName, O.Name AS LockedObjectName, P.object_id AS LockedObjectId, … Read more
Using annotation mappings as an example: Configuration cfg1 = new AnnotationConfiguration(); cfg1.configure(“/hibernate-oracle.cfg.xml”); cfg1.addAnnotatedClass(SomeClass.class); // mapped classes cfg1.addAnnotatedClass(SomeOtherClass.class); SessionFactory sf1 = cfg1.buildSessionFactory(); Configuration cfg2 = new AnnotationConfiguration(); cfg2.configure(“/hibernate-mysql.cfg.xml”); cfg2.addAnnotatedClass(SomeClass.class); // could be the same or different than above cfg2.addAnnotatedClass(SomeOtherClass.class); SessionFactory sf2 = cfg2.buildSessionFactory(); Then use sf1 and sf2 to get the sessions for each database. For … Read more