|
|
-
|
|
Generally it is considered good practice using two-part names for objects. It make the code more readable and avoids confusion if objects with similar names exists in different schemas. Some features requires that two-part naming must be used such as creat...
|
|
-
|
|
When connecting to a server from SSMS using Windows Authentication, you are limited to using only user which you used to log on to Windows. For example, if you login using User1 on Windows and launch SSMS, you can only use User1 to connect to a server from...
|
|
-
|
|
Yesterday, I received two mails from the Microsoft Certification Program Team about two new certification earned:
1. Microsoft Certified Solutions Associate – SQL Server 2008 Core
2. Microsoft Certified Solutions Associate – Windows Server® 200...
|
|
-
|
|
You can easily import data from an Excel file to SQL Server using SQL Server Import and Export Wizard. However, when the data is simple and limited I avoid using it (too lazy to click through 6 screens… ) instead I generate INSERT statements using CONCAT...
|
|
-
|
|
When it comes to exporting data there are different options available in SQL Server, such as SQL Server Integration Services, Generating Insert Scripts, BCP, Import and Export Wizard and SQLCMD.
When it comes to exporting data as CSV file, BCP and SQLCMD a...
|
|
-
|
|
This is a follow up post from a comment on my blog.
Earlier I posted about using xp_instance_regread to get default data location for current instance. It translates a given registry path to instance specific registry path. This can return the value for a ...
|
|
-
|
|
Getting row count for all tables in a database is straight forward. You can display row count for all tables by joining sys.objects and sys.partitions as below:
[UPDATE: sys.partitions only shows an approximation of the number of rows. (http://msdn.micros...
|
|
-
|
|
Identifying current service pack installed for SQL Server can be difficult if you don’t know which command to use! Most of the time I have seen people using @@VERSION to check for SQL Server service pack level, which is not correct as it returns the ...
|
|
-
|
|
The sys.dm_exec_requests is a great way to find out how long the BACKUP will take to complete. If you are doing a backup WITH STATS or by GUI, you will not need to use the DMV. But, if someone else is running a backup (or a Job), you can find the percent o...
|
|
-
|
|
You run into this error when using sys.dm_db_index_physical_stats DMV on a database which is running under SQL Server 2000 (80) compatibility mode.
USE [SqlAndMe]
GO
SELECT *
FROM sys.dm_db_index_physical_stats
(DB_ID('SqlAnd...
|
|