Viewing 15 posts - 106 through 120 (of 2,893 total)
Since @CompanyName is also part of the table name it would be easy to leverage sys.objects to see if that table exists.
...
or use OBJECTPROPERTY function.
No cursor or loop requried...
July 3, 2014 at 8:27 am
STYLES (7/1/2014)
this is where i am at and stuck
declare @period_name as date = 'DEC-10'
case when substring(period_name,5,2) = '@periodname' THEN SUBSTRING('@periodname' ,5,2)
the period names are in format ...
July 1, 2014 at 10:58 am
In the OP case, there are many ways to write the query to return the same results, eg. using temp tables for intermidiate results...
Again, it's impossible to generalise the best...
July 1, 2014 at 10:53 am
July 1, 2014 at 10:27 am
Use
Oracle DECODE = T-SQL:
CASE WHEN [condition 1] THEN [expression 1]
WHEN [condition 2] THEN [expression 2]
...
July 1, 2014 at 10:24 am
nonghead-webspam (7/1/2014)
This is on a reporting database, not a...
July 1, 2014 at 9:49 am
... My colleague argues that it is more efficient to use derived tables rather than joining two tables say and filtering with a Where clause. ...
You can argue to the...
July 1, 2014 at 9:40 am
...Must NoLock be used only on a query selecting from a table, or can it be on a table-returning function?
You better not to use NoLock at all.
What is your...
July 1, 2014 at 9:26 am
Alan.B (6/19/2014)
Eugene Elutin (6/19/2014)
SUBSTRING is more standard than PARSENAME so the code would be more portable using SUBSTRING (for those people that care about that stuff :-P)
Yep, as long...
June 20, 2014 at 3:57 am
Chris Wooding (6/20/2014)
Surely SELECT COUNT(*) should return 42?
Why so? Of course not!
On a clear, moonless night about 3,000 stars are visible with the unaided eye. A small telescope will...
June 20, 2014 at 3:30 am
SUBSTRING is more standard than PARSENAME so the code would be more portable using SUBSTRING (for those people that care about that stuff :-P)
Yep, as long you port to...
June 19, 2014 at 11:23 am
May I ask please, if there is any reason to use SUBSTRING instead of PARSENAME other than love of typing and having more of pink in the code, especially...
June 19, 2014 at 9:53 am
I hope I m not only the one here who cannot make any clue out of OP question...
What query brings data from source and destination?
What is your exepected results based...
June 19, 2014 at 9:46 am
Viewing 15 posts - 106 through 120 (of 2,893 total)