|
|
-
15 Liked
| 11 Learned
| 5 Comments
|
|
It is because sp_helptext may not return the correct procedure name as it returns text from syscomments system table. When a procedure is renamed using sp_rename, the text column of this table is not updated.
Consider this example
[code]
create proce......
|
|
-
|
|
SQL Server does Short-circuit and may not evaluate every condition in the WHERE clause. Consider the following statement which gives the error "Conversion failed when converting the varchar value 't' to data type int."
[code]select 7 where 't'=8[/code]......
|
|
-
10 Liked
| 11 Learned
| 5 Comments
|
|
While the following is not valid
[code]SELECT SYSDATETIME()-SYSDATETIME()[/code]
the following is valid
[code]SELECT SYSDATETIME()-GETDATE()[/code]......
|
|
-
|
|
Execute this to understand how you can nest EXEC
[code]EXEC('EXEC(''EXEC(''''EXEC(''''''''select 1 as number select * from sysobjects'''''''')'''')'')')
[/code]......
|
|
-
18 Liked
| 21 Learned
| 5 Comments
|
|
Careful! If you are using your old scripts to create database in SQL 2012, It might fail. In SQL Server 2012, Minimum database size is increased to 3MB. In before versions it is 2MB. So, if you run the same script with initial size specified as 2MB, it ......
|
|
-
|
|
If you come across the following error while running a T-SQL query or executing a stored procedure or in a SSIS package execution which states:
"The transaction log for database 'DatabaseName' is full. To find out why space in the log cannot be reuse......
|
|
-
|
|
Today, I learnt something new which is not really new but unknown for me about ODBC scalar functions. I never see people used these functions very frequently. Thought of sharing with all....
Eg:
select {fn current_date()}
select {fn current_time()}......
|
|
-
|
|
Which one is better to use index on table or not?
Simple answer is for Small table no and for table with huge data yes.......
|
|
-
|
|
After last restarted SQL Server, we can know the total connections have been created in SQL Server with following system command,
[CODE]
SELECT @@connections
[/CODE]......
|
|
-
10 Liked
| 10 Learned
| 5 Comments
|
|
I just learned this from MSDN. Below script is used to find what are the stored procs are created with "Recomplie" option.
SELECT OBJECT_NAME(sm.object_id) AS ProcedureName,definition as SQLText
FROM sys.sql_modules SM
INNER JOIN sys.procedures S......
|
|