Viewing 15 posts - 7,666 through 7,680 (of 8,731 total)
Sean Lange (9/27/2013)
Luis Cazares (9/27/2013)
September 27, 2013 at 9:50 am
Today, I'm really pissed off with the database and network administrators. Because of the lack of good planning and best practices, instead of restrictions to our users permissions, they decided...
September 27, 2013 at 9:24 am
Sean Lange (9/27/2013)
Could do this with a case expression also so there is no need to use CAST.
select case when CHARINDEX('%', @Test) > 0 then 1 else 0 end
But CAST...
September 27, 2013 at 8:20 am
Why would you need this?
To achieve this, you would need to build a dynamic query and the process might be very inefficient. If you're trying to determine which columns are...
September 26, 2013 at 4:09 pm
Can you explain your problem? I don't understand how do you define your business rules.
Why are you using char(10) instead of a proper data type for time?
September 26, 2013 at 1:47 pm
That's because float and real are not exact numeric data types, they're approximate numerics and can generate different values than the ones intended.
September 26, 2013 at 10:08 am
For a more complete answer, please take a look at the article linked on my signature.
For an explanation on the pivot query, check the following articles:
September 26, 2013 at 9:22 am
I'm not sure if bcp would allow you to do that. However, you could load all data to a staging table and insert clean data into your final table to...
September 26, 2013 at 9:19 am
Be careful on using table variables, they might reduce performance on your query depending on the number of rows. You should test what's better for your performance (temp table, table...
September 26, 2013 at 8:38 am
It was easy to find the solution with the DDL and sample data you posted (I had to run the original query to get the expected results).
The important thing...
September 25, 2013 at 5:09 pm
An OUTER APPLY might do the job. There might be another option, but this looks like it should work fine.
INSERT INTO RunsByBench
SELECT BenchName AS BenchName,
COUNT(CreateDate) AS NumberOfRunsOnBench,
MAX(CreateDate) AS LastRun
FROM @benches...
September 25, 2013 at 4:52 pm
Try CHARINDEX and you could CAST it to bit so you will only get 1's and 0's.
Select CAST( CHARINDEX('@', 'AGDJS@JDJD') AS bit)--will show as 1
Select CAST( CHARINDEX('@', 'AGDJSJDJD') AS bit)...
September 25, 2013 at 4:27 pm
You have a nice plan and good ideas, but I would really suggest a different approach on the splitter. Check the following link to improve the performance of your strings...
September 24, 2013 at 10:08 am
Some people are just crazy and ask for weird things on reports.:-D
You helped a lot by posting all the ddl and sample data. With that and knowing the right techniques,...
September 24, 2013 at 9:33 am
I'm curious, why would you want to do this? I'm posting a way, but I'm bnot sure if it's the best idea to do it on SQL Server (and I'm...
September 24, 2013 at 9:11 am
Viewing 15 posts - 7,666 through 7,680 (of 8,731 total)