I am confused about a few points: What is the difference between a stored procedure and a view? When should I use stored procedures, and when should I use...
I have two t-sql queries using SqlServer 2005. How can I measure how long it takes for each one to run? Using my stopwatch doesn’t cut it. 6 Answers...
What’s the difference between a Database and a Schema in SQL Server? Both are the containers of tables and data. If a Schema is deleted, then are all the...
I’m no beginner to using SQL databases, and in particular SQL Server. However, I’ve been primarily a SQL 2000 guy and I’ve always been confused by schemas in 2005+....
I am using SQL Server 2005. I have a table with a text column and I have many rows in the table where the value of this column is...
What are the advantages and disadvantages of using the nvarchar(max) vs. NText data types in SQL Server? I don’t need backward compatibility, so it is fine that nvarchar(max) isn’t...
How can we check which database locks are applied on which rows against a query batch? Any tool that highlights table row level locking in real time? DB: SQL...
I created a database on my local machine and then did a backup called tables.bak of table DataLabTables. I moved that backup to a remote machine without that table...
I want to convert a string like this: '10/15/2008 10:06:32 PM' into the equivalent DATETIME value in Sql Server. In Oracle, I would say this: TO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:SS...
I’ve heard that you should put columns that will be the most selective at the beginning of the index declaration. Example: CREATE NONCLUSTERED INDEX MyINDX on Table1 ( MostSelective,...