database.emptyRecycleBin([select id from test__c where IsDeleted = true ALL ROWS]);   when i run the above and try to query the bin record, still record exist. What is wrong ? Please guide me !
122505
I did the following   1)Deleted a record in sfdc and then ran the query using ' ALL ROWS' keyword and i could see that as per the documentation that data from recycle bin is also retrieved with isdeleted=true  2)I deleted the record from recycle bin and now i observed that still i was able to retrieve it .  Can anybody aware why this happens ?  Also if i filter the records by date and use ALL ROWS will the date filter still apply?
91753
In a mysqli prepared statement, a NULL gets turned into '' (in the case of a string) or 0 (in the case of an integer). I would like to store it as a true NULL.  Is there any way of doing this?
110164
Like this: const void * test = sqlite3_column_blob(stat, 1); Can I delete or delete[] test?
67080
I have a table with 5 columnsID,CPT4,CPT4Mod,ItemCharge,Eff_Date.   Deletion Condition:  When rows exists with duplicate CPT4and CPT4Mod field values but different ItemCharge and Eff_Date values, exclude all but the most recent Eff_Date records.  I need a query which can achieve this in two scenarios.   When CPT4Mod is given by the user. When  CPT4Mod is not given by the user.   Later I need to achieve the same using LINQ.
123269
Inspired by a StackOverflow question ().  Is there a DBMS that actually supports the = NULL syntax?
73931
I have a Database nearly 1.9Gb Database in size, and MSDE2000 does not allow DBs that exceed 2.0Gb  I need to shrink this DB (and many others like this at various client locations).  I have found and deleted many 100's of 1000's of records which are considered unneeded: these records account for a large percentage of some of the main (largest) tables in the Database. Therefore it's reasonable to assume much space should now be retrievable.  So now I need to shrink the DB to account for the missing records.   I execute DBCC ShrinkDatabase('MyDB')...... No effect. I have tried the various shrink facilities provided in MSSMS.... Still no effect. I have backed up the database and restored it... Still no effect.   Still 1.9Gb  Why?  Whatever procedure I eventually find needs to be replayable on a client machine with access to nothing other than OSql or similar.
25421
I recently read that because of how InnoDB recalculates the AUTO_INCREMENT value when the server restarts, any records on the high end of the ID list may have their IDs reused.  Normally, this isn't a problem, because when a user is deleted everything associated with the ID is deleted from other tables too.  But I'm deliberately leaving their forum posts orphaned, labelled as "Posted by =User #123=", so that past conversations are retained. Clearly, should an ID be reused, this will be a problem.  I've never had this issue before because there were always enough new users to make it unlikely for an ID to be reused in this way. However on my new project signups are rare and inactive user deletions frequent (especially since the "Open Alpha" accounts only last for three days as a preview), and such ID reuse has happened three for three now.  I have "fixed" the issue by saving the correct value for AUTO_INCREMENT elsewhere and using that instead of relying on the internal value. Is there an actual way to have InnoDB remember the actual last value?
77817
It is a bit of a "chicken or egg" kind of query, but can someone dreamup a query that can return the name of the current database instance in which the query executes? Believe me when I say I understand the paradox: why do you need to know the name of the database instance if you're already connected to execute the query? Auditing in a multi-database environment.  I've looked at all the @@ globals in Books Online. "SELECT @@servername" comes close, but I want the name of the database instance rather than the server.
70966
I am attempting to create a query with the objects Opportunity, Courses__c, and Prior_Qualifications__c.   Opportunity has parent-child relationships with both Courses__c and Prior_Qualifications__c. I want to be able to query only information with valid Courses__c records, so that I can disregard any results returned with valid Opportunity object information, but no Courses__c information. Is there a way to do this? Am I able to make a query such that:  Select Id,  (Select Course_Name__c from Courses__r) from Opportunity where Courses__r.Course_Name__c != ''   I know that this isn't a valid query... but can I do something like this?
82767
I'm attempting to do this in a procedure:  DECLARE @a bit = 1; BEGIN     SELECT * INTO #aTemp FROM OPENROWSET( ... );      IF @a = 0     BEGIN         SELECT ... INTO #bTemp FROM #aTemp;     END     ELSE     BEGIN         SELECT ... INTO #bTemp FROM #aTemp;     END END   I get the error:  Msg 2714, Level 16, State 1, Line 10 There is already an object named '#bTemp' in the database.   Why is this happening and is there a work around?  Update  I've attempted to add a DROP statement as suggested , but it still does not work:  DECLARE @a bit = 1; BEGIN     SELECT * INTO #aTemp FROM OPENROWSET( ... );      IF @a = 0     BEGIN         IF OBJECT_ID('[tempdb]..#bTemp') IS NOT NULL         BEGIN             DROP TABLE #bTemp;         END          SELECT ... INTO #bTemp FROM #aTemp;     END     ELSE     BEGIN         IF OBJECT_ID('[tempdb]..#bTemp') IS NOT NULL         BEGIN             DROP TABLE #bTemp;         END          SELECT ... INTO #bTemp FROM #aTemp;     END END
45337
I'm making a Java application with an application-logic-thread and a database-access-thread. Both of them persist for the entire lifetime of the application and both need to be running at the same time (one talks to the server, one talks to the user; when the app is fully started, I need both of them to work).  However, on startup, I need to make sure that initially the app thread waits until the db thread is ready (currently determined by polling a custom method dbthread.isReady()). I wouldn't mind if app thread blocks until the db thread was ready.  Thread.join() doesn't look like a solution - the db thread only exits at app shutdown.  while (!dbthread.isReady()) {} kind of works, but the empty loop consumes a lot of processor cycles.  Any other ideas? Thanks.
122524
I tried dropping a table and then when i viewed the recycle bin nothing was there in it . Earlier too i dropped tables many a times but I was surprised to find no objects whatsover in it . What's the deal ? [update]: i had tried    SHOW PARAMETER RECYCLEBIN;  Its VALUE column shows it  as ON . So fine here ! Then i droppped an existing table but still the command     Select object_name from recyclebin;  and any such retrieval of columns is showing NO ROWS SELECTED !! Also using flashback command  confirms that recyclebin is not having any such dropped tables !! So where are dropped tables going ? And one more thing : This time i tried using  ALTER SYSTEM SET RECYCLEBIN=ON;    Instead of Alter session    and sqlplus throws an error : Specified initialization parameter is not modifiable with this option  So, is this because  that i am working as a SYSTEM ?? i have not created any other USER as of now .
99537
Correct me if I'm wrong here, but when you "delete" something from your PC all your computer does is write over some of the binary with 0's replacing the 1's.  (Or something to that effect) So when you send something to the recycle bin it writes over part of the file, and when you delete from the recycle bin it writes more?
60878
I've recently finished a project, during which many DB tables were created.   Most of these tables contain temporary garbage, and I am looking for a simple way to list all these tables.  Is there a way to list all DB tables sorted according to their creation date?
18221
How can I restore a mysql database that was dropped using a "drop database" command? I have access to binary logs which should make this type of rollback possible.
83578
i need to count total number of records in an sObject which can have around one million records. Will the code below work ? If no, how can this be done ? I dont need to use this in a vf page.   I will be using this COUNT() SOQL Query in a batch class which is scheduled to run at specific time.  AggregateResult results = database.query('SELECT COUNT(id) result FROM someSObject');     System.debug('No of ids are: '+results.get('result'));
81018
I have "zero filled" (complete wiped) an external hard disk using dd, and from what I have heard: people said you should at least "zero fill" 3 times to be sure that the data are really wiped and no one can recover anything.  So I decided to scan the disk once again after I've zero filled the disk. I was expecting the disk to still have some random binary left. It turned out that it has only a few sequential bytes in the very beginning. This is probably the file structure type and other headers stuff. Other than that, it's all zeros and nothing else.  So if we have to recover any file from a zero filled disk, ...how? From what I've heard, even you zero fill the disk, you should still have some data left. ...or could dd really completely annihilate all data?