The SELECT statement you’re running isn’t what it’s cracked up to be. See how SQL really sees your query. This is the SQL Order of Operation.
SQL Server
The SELECT statement you’re running isn’t what it’s cracked up to be. See how SQL really sees your query. This is the SQL Order of Operation.
Before you go deleting millions of records DON’T! You need to watch this video to understand why you should not delete records in one full swoop but rather in blocks.
Inserting millions of rows will take a tow on the transaction log. When you’re inserting this much data, your log file will quickly grow and will have potentials to crash your database. To help relieve the pressure of the log file, you’ll want to insert in batches (this is something that is done in SSIS).
Why should you use many schemas?
So what’s the big difference between Union and Union All? Let’s take a look.
Here’s a short video on using some basic MS SQL Functions
Schema’s are use to help isolate users to a specific schema, ETL purposes, reusing a table name that already exists, and etc. reasons. In this video, I’ll show you how to import data into a table. Once the data is ready an Alter Schema is performed to prevent any downtime of the table.
Do you want to use Oracle’s driver to directly connect to an Oracle database instead of using ODBC (DSN)? Is it any faster? You be the judge!
Make sure you have Oracle 12g drivers installed on the server. This could be any version of Oracle
Make a note as to where your Oracle installation path is. You’ll need a few information from the TNSADMIN.ora file. For example, my path is C:\Oracle\Ora12\Network\Admin\tnsadmin.ora
Inside tnsadmin.ora, you’ll need the HOST, PORT, and SERVICE_NAME
In SSMS, navigate to the OraOLEDB.Oracle providers and open up the properties
Create a Linked Server
This is how you would use your new shiny Oracle Linked Server
SELECT * FROM OPENQUERY(“ORACLE”, ‘SELECT * FROM MyTable’) AS MyTable
Sometimes a very large database (VLF) stalls and or takes forever and a day to perform a 2 minutes task. In these fun times we restart the server. It gets funner when the server is back online and your database is IN RECOVERY.
This generally happens prior to the server restart, you still have large transactions running (i.e. millions/billions or records being DELETE/UPDATE/INSERT).
To check on the status of your database simply run
EXEC sys.sp_readerrorlog 0, 1, ‘Your_Database_MDF_Name’
At this point, you can’t use sp_helpfile because your database is inaccessible therefore navigate to where the mdf file is located. Most of the time, the mdf file is the same name as your database.
When you run the command above, in your message tab you’ll see the percentage of completion and how many seconds to go.
There are times when you want to delay a script such as sending yourself a reminders or to run a job/stored procedure/etc.
BEGIN
WAITFOR TIME ’01:10′;
PRINT ‘This message will print at 1:10 am’;
END;
BEGIN
WAITFOR DELAY ’01:00′;
PRINT ‘This message will print in one hour’;
END;
You must be logged in to post a comment.