Viewing 15 posts - 7,951 through 7,965 (of 8,731 total)
Thank you for completing the information Erland. I just gave a starting point but as you've said, there's a long way to go from there (unless the OP takes the...
July 4, 2013 at 5:01 pm
Depending on the requirements, you might want to use RANK instead of ROW_NUMBER if you need to bring up ties instead of a single best.
July 4, 2013 at 4:50 pm
Unless you store all the queries that run on your server (or at least the more expensive), there's no way you can obtain them from a script.
However, you can use...
July 4, 2013 at 10:56 am
You might want to read these articles.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns[/url]
July 4, 2013 at 9:14 am
You might want to take a look at this book if you're going to take care of the database
Troubleshooting SQL Server: A Guide for the Accidental DBA[/url]
July 3, 2013 at 6:15 pm
You're right Ed, I called it a dummy table and you called it inbox table but we're referring to the same thing. There's not much difference on our methods, it's...
July 3, 2013 at 3:31 pm
You can use a CASE statement.
SELECT q.Course_Code, CASE WHEN res.[4a] = 0 THEN 0 ELSE 6-res.[4a] END as [4a],
...
July 3, 2013 at 2:20 pm
I'm with Lowell on cleaning up the data.
However, this might help you, but you still have to review the matches given.
;With Table1([AppID],[Appname])
AS
(
SELECT 'Null','CSO Services Operations' UNION ALL
SELECT 'Null','CSP' UNION ALL
SELECT...
July 3, 2013 at 2:17 pm
Here's an idea, you might have to work on it.
First, insert into a dummy table with an identity column and a varchar column (the length might depend on your file....
July 3, 2013 at 2:05 pm
COALESCE will do an implicit conversion using Data Type Precedence.
The convertion from COALESCE to CASE is just the way COALESCE works (at least a part of it).
For more information on...
July 3, 2013 at 1:47 pm
Something like this?
DECLARE @fullstreet varchar(50) ='100 NW 25 St APT# 303'
SELECT LEFT( @fullstreet, PATINDEX('%APT%', @fullstreet)),
REPLACE( RIGHT( @fullstreet, 1 + LEN( @fullstreet) - PATINDEX('%APT%', @fullstreet)), 'APT# ', 'Apartment = #')
Depends...
July 3, 2013 at 1:40 pm
I wonder if you're missing the quote marks or if it was a copy/paste error.
EXEC master.sys.sp_MSforeachdb
N'INSERT INTO Dba_admin.dbo.databaseDataFileSize
SELECT ''?'', SUM(size) * 8, cast(getdate() as date), cast(getdate() as time)...
July 2, 2013 at 6:51 pm
What are you trying to do? It seems to me that you want either one of these options.
Without sample data and expected results there's hard to know.
Select LEFT(FT.DESCAR,CHARINDEX('|',FT.DESCAR)-1) from FT
where...
July 2, 2013 at 5:19 pm
TMP_URE is the name that you supplied in your code. I assumed that was your table. You should change it for the dynamic code to run.
July 1, 2013 at 4:50 pm
I'm not sure if I can be of great help. My problem is that I can't see what you see.
I gave you a link to an article that explains very...
July 1, 2013 at 1:45 pm
Viewing 15 posts - 7,951 through 7,965 (of 8,731 total)