|
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
If you ever add a default constraint on a table without giving it a name, SQL Server will give it a somewhat random name which you cannot guess.
To drop those constraints such a query might come in handy:
DECLARE @query NVARCHAR(MAX)
SET @qu...
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
to find locked tables in SQL Server 2005 ,
> sp_lock
and use Object_Name() to find out name of the table,
> SELECT Object_Name(ObjectID)
...
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
to find locked tables in SQL Server 2005 ,
> sp_lock
and use Object_Name() to find out name of the table,
> SELECT Object_Name(ObjectID)
...
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
Today, I could not remember quickly how we check for the existence of schema in a database. This is not something I just learned, but something I forgot over the course of time. Since I don't want to rummage through my scripts or hit the web and to h...
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
Today, I could not remember quickly how we check for the existence of schema in a database. This is not something I just learned, but something I forgot over the course of time. Since I don't want to rummage through my scripts or hit the web and to h...
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
I have always heard about the terms sargable and non-sargable but never really understood how they help in developing efficient sql code. Here is what I have found out...
Try to avoid WHERE clauses that are non-sargable. The term “sargable” (which i...
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
I have always heard about the terms sargable and non-sargable but never really understood how they help in developing efficient sql code. Here is what I have found out...
Try to avoid WHERE clauses that are non-sargable. The term “sargable” (which i...
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
I did not expect the following code to run:
(((((((SELECT * FROM sys.objects WHERE type = 'U')))))))
But it does, just fine.
I believed that parentheses were only an *expressive* construct and never a *procedural* one. I'm quite familiar with deri...
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
I did not expect the following code to run:
(((((((SELECT * FROM sys.objects WHERE type = 'U')))))))
But it does, just fine.
I believed that parentheses were only an *expressive* construct and could never stand in place of a *procedur...
|
-
Hardik Doshi knew 1 Years ago through Just Learned | 1 Point
From a disconnected query window, we can connect back to the SQL Server instance from the **Query > Connection > Connect** menu option. This may sound simple, but I found this interesting.
I usually press F5 (or execute button) twice to get connecte...
|