Viewing 15 posts - 3,256 through 3,270 (of 4,087 total)
Jeff Moden (3/30/2012)
Heh... a Rose, by any other name, is still a Rose.Unless I'm mistaken, all of the examples above all boil down to some form of parent/child relationship.
I'm not...
March 30, 2012 at 4:54 pm
Use FOR XML PATH('') to concatenate your string together. There are several articles on how to do this. In my quick scan, this covered the basics well. Creating...
March 30, 2012 at 4:35 pm
Sure try the key phrase "foreign key". You act as if foreign keys to the same table are somehow mysteriously different from foreign keys to other tables, but they're...
March 30, 2012 at 1:08 pm
It's hard to give you any help without more details. For instance, you don't mention how you are copying your Excel file to the database—SSIS, OPENROWSET, etc.
Drew
March 30, 2012 at 9:24 am
A simple modification of my previous response will give you the results you want. Of course, including the HAVING clause excludes both of your records.
DECLARE @QuarterEnd DATE = '2011-12-31'
SELECT...
March 30, 2012 at 7:25 am
I think that you are overcomplicating things by using the wrong aggregate. Instead of using COUNT(1) you should be using COUNT(DISTINCT <some expression>)
I think this does the exact same...
March 29, 2012 at 3:12 pm
dwain.c (3/26/2012)
DECLARE @clients TABLE (clientno VARCHAR(20))
INSERT INTO @clients
SELECT '55566' As...
March 29, 2012 at 10:17 am
Did you try the CROSS APPLY? The only change will be that you need to change the WHERE clause to bo.userid = u.[id]
Drew
March 29, 2012 at 9:44 am
You'll want to use an APPLY. Since you're data doesn't match your current results, this is a pure guess at what you want.
SELECT u.[ID], bo.BackOfficeID
FROM Users AS u
CROSS APPLY...
March 29, 2012 at 8:36 am
Image has been deprecated. You should avoid using it in new development. Use varbinary(max) instead.
Drew
March 28, 2012 at 7:45 am
jothibhatt_s (3/27/2012)
I want to handle it in database instead of handling...
March 28, 2012 at 7:24 am
That subject is too long for a forum post, but you can search the web for "database normalization". Some quick points
* You have to search multiple fields instead of...
March 27, 2012 at 8:59 am
You don't say what you want it to be a function of. I assume jobkey and maybe date.
My recommendation is DON'T use a scalar UDF. You will probably...
March 26, 2012 at 3:55 pm
Cadavre (3/26/2012)
seth delconte (3/26/2012)
REPLACE works too 😀
SELECT id,Nivel,REPLACE(A,'0','')A,REPLACE(B,'0','')B...
FROM @tblCron
I try to avoid implicit conversions where possible
The other thing is that it's not a general solution. Consider what would...
March 26, 2012 at 11:42 am
You don't really want to create tables like that, because it makes your data much harder to work with. Sometimes you may need to output data in that format...
March 26, 2012 at 7:53 am
Viewing 15 posts - 3,256 through 3,270 (of 4,087 total)