Viewing 15 posts - 6,721 through 6,735 (of 8,731 total)
Ville-Pekka Vahteala (3/20/2014)
And here is the English link.
I'm sorry, sometimes I forget to change it.:-D
March 20, 2014 at 10:35 am
Based on that sample data. What should be the output?
March 20, 2014 at 10:31 am
I'm assuming that you know how to create a variable (If you don't please tell me).
You have to ensure that your variable scope is set to the package.
Then you add...
March 20, 2014 at 10:18 am
You're right Jessie there are simpler and more effective ways to do this.
SELECT SUM( CASE WHEN IDDM.ACTL_PROC_CD COLLATE Latin1_General_CI_AS IN('PP', 'P2') THEN 1
WHEN IDDM.ACTL_PROC_CD COLLATE Latin1_General_CI_AS IN('RP', 'DR') THEN...
March 20, 2014 at 10:00 am
You're welcome. Be sure to understand how and why does it work.
I'm glad I could help.
March 20, 2014 at 9:42 am
Is CHAR(9).
You need to remember that Books On Line is your friend 😉
March 20, 2014 at 9:41 am
This isn't a pretty solution, but have you tried using REPLACE?
select top 300
Avg_CPU_Time
,Total_Physical_Reads
,convert(datetime,Last_execution_time) as Timestamp
,Stored_Procedure
,REPLACE(REPLACE(Query_text, CHAR(13), ' '), CHAR(10), ' ') AS Query_text
from dbadmin.dbo.History_CPU_IO_ByQueryAndSP
March 19, 2014 at 3:20 pm
You could have a variable that changes its value inside the foreach loop and use it in the constraint after the loop.
March 19, 2014 at 3:05 pm
You could use HAVING clause to get what you need (there are other options as well).
It's considered a good practice to post your sample data in a consumable format along...
March 19, 2014 at 2:44 pm
You could try something like this:
WHERE somecolumn NOT LIKE '%[^0-9.]%'
This won't be completely safe as it will return false positives for values with more than one point(.).
March 19, 2014 at 2:32 pm
Because that's the task designed for that purpose. What else would you use?
March 19, 2014 at 1:35 pm
That's an implicit conversion. You can check this:
SELECT CAST('' AS int), CAST('' AS datetime), CAST('' AS bit)
The question is what do you want instead of the zero? you...
March 19, 2014 at 1:18 pm
I'm not sure about the best option, but I would say that using a single table adding columns for cancellation information.
I wouldn't use a bit (it might be the...
March 19, 2014 at 11:24 am
Just wanted to add a different approach to unpivot explained in this article:
http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/
--Using MysteryJimbo data
SELECT ID, ProductName, MIN(Cost) as MinCost
FROM @test
CROSS APPLY (VALUES(Cost1), (Cost2), (Cost3), (Cost4))Costs(Cost)
GROUP BY ID, ProductName
March 19, 2014 at 11:17 am
brn2code (3/19/2014)
Have a look here: http://stackoverflow.com/questions/21547/in-sql-server-how-do-i-generate-a-create-table-statement-for-a-given-table
That was my point, but I didn't have an example ready. 😀
I'm making the link clickable to make it easier for others.
March 19, 2014 at 11:08 am
Viewing 15 posts - 6,721 through 6,735 (of 8,731 total)