Viewing 15 posts - 61 through 75 (of 194 total)
I want to Correct myself....
I just tested this again and even explicit conversion gives the result as in Jeffs first example. I played some more and it appears that...
October 27, 2008 at 2:06 am
Jeff, I think your example is somewhat misleading...
In the first query SQL converts all the inputs into the most datatype of highest precedence possible, i.e Binary, which is always Numeric.
In...
October 27, 2008 at 1:38 am
nChar() is Fixed length
and nVarChar is variable length.
In practice, the disk space used is
nChar(5) => will always use 12 Bytes ( 2 *n ) +2
nVarChar(5) = > uses 3...
October 27, 2008 at 1:29 am
I second Jeffs sentiments. I had to do this aswell, and without management support DB standards get nowhere. Especially in the face of non DB developers and Administrators...
October 27, 2008 at 1:21 am
If you had a Date you could also use
Declare @Date int
Set @Date = getDate()
Select Case Datepart( year, @Date ) % 4
when 0 Then 1
...
October 27, 2008 at 1:05 am
Sorry for posting the whole script again. some minor changes required but the code below gives the required result.
I changed the script to
1. Take All codes into Account...
October 27, 2008 at 12:58 am
No problem with the delay. I just wanted to know if it has solved your problem...I will check the scenario where it gives the incorrect answer
October 27, 2008 at 12:18 am
A data sample ( real or fictional) would help to understand the problem and therefore solve the problem
October 24, 2008 at 11:14 pm
In my experience when dealing with dates it is best to be explicit about the format. Although format 112 (ISO) is nice, I Have found that format 120 (ODBC...
October 24, 2008 at 3:41 am
This should be what you are looking for
If Exists(
---Check if such a row exists
Select top 1 * From Tab where Col is...
October 24, 2008 at 3:35 am
This should be what you are looking for
If Exists(
Select top 1 * From Tab where Col is Null
)
Begin
Raiserror( msg.......)
End
October 24, 2008 at 3:35 am
The solution to this is very much like a solution I posted earlier, but not without a row identifier as mentioned before.
October 24, 2008 at 3:16 am
You asking for standard Split functionality... There are many threads (and articles) on this site dealing with this)
A search on "split" should give you the result you want
Sorry I...
October 24, 2008 at 2:34 am
either one of the following does what you are asking. The Second query is marginally faster
Update Tgt
Set ColA = Src.ColA
From #MyTable as tgt
Left join(
Select
TgtID = t.CoID
,Src.*
, RowNum...
October 24, 2008 at 1:51 am
Viewing 15 posts - 61 through 75 (of 194 total)