Viewing 15 posts - 61 through 75 (of 90 total)
kalpit_yellow (4/10/2013)
SELECT ec.session_id, connect_time,s2.[text] as Last_Executed_SQL
...
April 10, 2013 at 10:36 pm
What will consume the results of the query? Just about any reporting front-end will have the facility to pivot the results to the format you want. This is...
April 10, 2013 at 6:09 pm
Also try the Sql Server Configuration Manager and see if any Aliases were created.
April 9, 2013 at 4:23 pm
There is no need to hard-code each payment type in a pivot query. Dynamic SQL can take care of that.
April 8, 2013 at 8:59 pm
The CASE statement is used for conditional substitution of values, not formulae.
Perhaps the logic can be refactored into the WHERE clause?
April 8, 2013 at 8:29 pm
Use UNPIVOT to turn each PAYMENT_TYPE into its own column. See the following link.
Then your calculation should be easy 🙂
April 8, 2013 at 8:19 pm
Try using DATEDIFF
http://msdn.microsoft.com/en-nz/library/ms189794%28v=sql.100%29.aspx
In conjunction with ROUND
http://msdn.microsoft.com/en-us/library/ms175003%28v=sql.100%29.aspx
For example:
declare @work_order_end_date date
declare @work_order_start_date date
set @work_order_start_date = '2012-12-03'
set @work_order_end_date = '2013-05-31'
select round(datediff(d, @work_order_start_date, @work_order_end_date) / 30.0, 0)
April 8, 2013 at 8:11 pm
Use SQL Server Profiler to run a trace on your database. When creating the trace, tick show all events, and go under the Performance heading to choose a showplan...
April 8, 2013 at 7:32 pm
This is probably because of the data types of your numerical columns. Please post DDL statements for all the tables referenced in the query.
Also take a look at the...
April 8, 2013 at 7:17 pm
From what I understand of your question, a simple UNION ALL will get you what you need. The example answer assumes that both databases are in the same server....
April 7, 2013 at 10:36 pm
I found this article a helpful introduction to what Wait States are, how to check them, and most importantly how to interpret the results 🙂
http://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/[/url]
April 4, 2013 at 9:40 pm
Can you please reproduce the problem and post your table creation, data, and query scripts in this format[/url]?
April 4, 2013 at 8:31 pm
Interesting. Looks like you hit a similar problem to this:
http://www.glorf.it/blog/2008/05/16/sql-talk/sql-server-is-not-aware-of-nondeterministic-functions
In query #1, the non-deterministic function in the subquery is applied after the join (also note the "No...
March 21, 2013 at 6:45 pm
You can use the following SQL to compose the comma-delimited string, without needed to trim the trailing comma at the end:
SELECT @MyStatusList = ISNULL(@MyStatusList + ',', '') + StatusDesc FROM...
March 20, 2011 at 9:14 pm
I would say "Yes" to all three especially with Reporting Services.
March 2, 2011 at 6:54 pm
Viewing 15 posts - 61 through 75 (of 90 total)