SQL Server upto 2008 (supposedly fixed in 2012) has a known bug regarding the scope_identity() function. It may return incorrect values when running a parallel insert.
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE ‘%User_name()%’
Goal: look for “User_name()” in all the stored procedures
Result: the query will return the name of all the stored procedures containing this “User_name()” text.
design the actual physical database based on the preceding logical design
Database design is the process of creating a business model that you use to convert business objects into database components (tables & views). Data modeling aims to produce a complete, accurate, and consistent representation of objects and the relationships between them in the real world.
DBCC FREEPROCCACHE
Remove all elements from the procedure cache.
DBCC FREESESSIONCACHE
Flush the distributed query connection cache.
DBCC FREESYSTEMCACHE
Release all unused cache entries from all caches.
Key:
NO_INFOMSGS
Suppress all information messages
ALL
All supported caches
MARK_IN_USE_FOR_REMOVAL
Free up currently used entries asap (asynchronous), will not prevent new entries being created in the cache (Requires ALTER SERVER STATE permission on the server).
DBCC DROPCLEANBUFFERS
Remove all clean buffers from the buffer pool
WITH NO_INFOMSGS
Suppress all information messages
This command is useful to test queries with a cold buffer cache without shutting down and restarting the server. To produce a ‘cold’ buffer cache with all dirty pages written to disk, first use CHECKPOINT.
Instead of checking for process name and process owner, try Mutex. Mutex, Mutual Exlusion, is synchronization primitive that can be used for inter-process synchronization (owned by a single thread at any given time). http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx
static void Main()
{
bool createdNew = true;
Mutex mutex = new Mutex(true, "ApplicationName", out createdNew)
if (createdNew)
{
//start the application
}
else
{
//put the focus on the application
Process current = Process.GetCurrentProcess();
foreach (Process process in
Process.GetProcessesByName(current.ProcessName))
{
if (process.Id != current.Id)
{
SetForegroundWindow(process.MainWindowHandle);
break;
}
}
}
}
When Intel releases its new architecture, Sandy Bridge, Intel also releases its new processors: i3, i5 and i7.
i3 has dual core base, hyper threading support, and virtualization. It’s known to perform closely to lower end Core 2 Quad processors.
Comparing to i3, i5 will give a noticeable difference in term of speed. There are 2 type of i5: dual core (32nm technology, hyper threading support, virtualization support, and Turbo Boost technology) and quad core (45nm technology, virtualization support and Turbo Boost technology, but do not have hyper threading support).
Comparing to i5, i7 promises to be faster. However, unless you’re running an application that uses 8 threads, you won’t notice much differences between the two. There are two different chip sets for i7, LGA1156 (800s) or LGA1366 (900s).
—————–
Hyper-Threading is Intel’s simultaneous multi-threading technology that presents each physical core as two logical cores to an operating system.
I’m trying to restore a database from .bak file and receive this error:
Cannot open backup device. Operating system error 5 (Access is denied). RESOTRE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)
My attempts:
Restart MS SQL Server Service using Local System Account with Allow service to interact with desktop checked. (failed)
Make sure i have the right security on the .bak file by right click on the file > properties > Security tab > click Advanced button > and make sure Allow inheritable permissions from the parent to propagate to this object and all child objects. Include these with entries explicitly defined here. is checked. (worked)