Viewing 15 posts - 5,551 through 5,565 (of 59,072 total)
In my company's case we use that date of 2078-12-31 as the maximum date because there are fields in some tables that are defined as SMALLDATETIME and since the...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 27, 2021 at 8:10 pm
Rewriting it using the temp table is an option I did consider but was hoping for one of those “a ha” moments ??
The "a ha" moment is in 2nd...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 27, 2021 at 6:35 pm
I am using SQL server 2008 R2 express edition.
Out of below 3 method which method is efficient to fetch count ?
1.select name,count * from table where name contains 'raj'...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 27, 2021 at 6:33 pm
That's some very clever code on the part of both. The only trouble with that code is that it contains date literals which are based on the content of the...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 27, 2021 at 2:18 am
You bet. Thank you for the feedback.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 8:11 pm
Not at all. sys.dm_exec_sql_text() returns the database ID... use it in conjunction with what I posted about OBJECT_NAME() above.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 6:43 pm
This is great.. I am making progress and learning. LOL.
Can I do this, within the same statement?
IIF(var1Title != '', CONCAT(var1Title, ' - '+var1Topic, ' - '+var1Name), '') AS Item1,...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 6:34 pm
Since it appears that you may be working from a different database via the code, here's a possible hint from the documentation on OBJECT_NAME (emphasis is mine)...
OBJECT_NAME ( object_id [
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 5:56 pm
I do not consider "2359 to 2359" a valid case, as that might imply it may also span multiple days
Ordinarily, I'd agree but to consider the span...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 5:01 pm
This is why I asked the OP for what they expected if the output were to be displayed...
IF the " - " that leads a NULL value are to NOT...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 4:52 pm
jcelko212 32090 - Thanks, appreciate this. As mentioned, I am relatively new to SQL. I'll continue to read up...
The Dixie Flatline - the result that I am hope for...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 4:19 pm
Three decades ago, I tried posting super consolatory postings. I tried fixing one and only one problem at a time when somebody posted a total mess. I found out...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 4:05 pm
GUIDS are big, fat and ugly... they bloat indexes. 😀
Yep... but they work a whole lot better than trying to gerry rig a concurrent MAX solution for this and...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 2:47 am
Yes, but I just recommended against doing that.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 12:38 am
Gosh, no. Don't change the SET CONCAT_NULL_YIELDS_NULL setting on your server or in your session! Use the CONCAT function instead. Please read the following...
https://docs.microsoft.com/en-us/sql/t-sql/functions/concat-transact-sql?view=sql-server-ver15
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2021 at 12:06 am
Viewing 15 posts - 5,551 through 5,565 (of 59,072 total)