|
|
-
|
|
As you know $ is zero from this tip http://beyondrelational.com/justlearned/posts/135/is-equal-to-zero.aspx, you can do all arithmetic operations with it
[code]select $+5, $*12, $+0.7, $/1[/code]......
|
|
-
18 Liked
| 18 Learned
| 7 Comments
|
|
I just learned that while working in SSMS if you have a doubt you can ask in msdn forum using
the toolbar "Community > Ask a question" and the forum web page opens right within Books Online.......
|
|
-
|
|
Using WITH statement you can create a series of data and use them in your queries.
Sample 1. Integer-Series
WITH T(ID) AS
(
SELECT 1 ID
UNION ALL SELECT ID + 1
FROM T
WHERE ID
Sample 2: Time-Series
WITH T(Date) AS
(
SELECT CONVERT(datetime, ...
|
|
-
|
|
Do you know ANSI-92 versions of T-SQL therefore early 6.5 version was so programmatically influenced. This was tha old-style LEFT OUTER JOIN syntax.
SELECT TableX.ID, TableY.ID
FROM TableX, TableY
WHERE TableX.ID *= TableY.ID
The ...
|
|
-
|
|
"SQL Authority" Pinal Sir published a tip about $rowguid, which can be used to fetch uniqueidentifier column from a table. It was awesome. You can find the link below.
[SQL SERVER – Identifying Column Data Type of uniqueidentifier without Querying Syst...
|
|
-
|
|
I stumbled across a scenario where I had to find all the triggers associated with few tables. Found the below queries and felt that they are worth sharing. I am listing the helpful sql queries!
To get a list of all the triggers in the database
sel...
|
|
-
11 Liked
| 11 Learned
| 6 Comments
|
|
This query comes as an answer to the following tek-tips forum thread http://tek-tips.com/viewthread.cfm?qid=1672424
The task was to extract 7 digit numbers from a string.
My solution is a simple straight-forward recursive CTE, although perhaps a b......
|
|
-
|
|
Do you know you can use system functions these way?
[code]
select * from
(
select 1 as number
) getdate(a)
[/code]
[code]
select * from
(
select 1 as number
) sum(a)
[/code]
[code]
select * from
(
select 1 as number
) count(a)
[/code......
|
|
-
19 Liked
| 17 Learned
| 6 Comments
|
|
KEEPIDENTITY applicable only in an INSERT statement when the BULK option is used with OPENROWSET. Specifies that the identity value or values in the imported data file are to be used for the identity column. If KEEPIDENTITY is not specified, the identit......
|
|
-
|
|
Recently we had a very puzzling situation. The stored procedure worked fine from the two desktop applications, but failed when called from the middle tier dll in the web environment. My colleague spent quite an amount of time debugging this problem and ......
|
|