Viewing 15 posts - 8,296 through 8,310 (of 14,953 total)
Add this to your Where clause:
and ID in (select id from XYZ group by id having count(*) = 1)
September 29, 2009 at 9:22 am
Before you jump in and try this on a production database, test it first on a copy of the data that you can replace if it gets messed up.
September 29, 2009 at 7:32 am
Calendar table is definitely the best way to go.
Here's a mathematical method, using a Numbers table.
;
WITH CTE(Date, Seq)
...
September 29, 2009 at 7:30 am
Is "desprod" the column you want to change?
If so, try this first:
select replace(desprod,left(desprod,PATINDEX('%/%',desprod)),'')
from dbo.MyTable;
You'll need to use the actual table name, where I have "MyTable".
Does that give you a list...
September 29, 2009 at 7:00 am
Right before you execute the string, add "print @sql", see what you get.
September 29, 2009 at 6:57 am
I touch-type over 80 words per minute, and I have big hands with long fingers. Netbook keyboards, even most laptop keyboards, are simply too small for me. They...
September 29, 2009 at 6:52 am
It'll depend completely on your specific data.
For example, do you have any entries that aren't simply last-comma-first? Like "Smith, Jr, John" ("John Smith, Jr")? Do they all have...
September 28, 2009 at 3:28 pm
It can be pretty static, but it can also have stuff in it if someone (hopefully a DBA) decided that all future databases on that server should have those things....
September 28, 2009 at 3:27 pm
The code on Simple-Talk uses OLE automation. The error you're getting is that you aren't set up to do that on the server you're trying it on.
Do you have...
September 28, 2009 at 3:22 pm
The most likely answer is parameter sniffing. Gail Shaw has a good article on that at http://sqlinthewild.co.za/index.php/2007/11/27/parameter-sniffing/.
Read that, and if you still need help on it, please post the...
September 28, 2009 at 3:18 pm
@result is just a variable being used for the sample code.
You'd use your column name instead.
September 28, 2009 at 3:16 pm
Tobie-189314 (9/28/2009)
September 28, 2009 at 3:09 pm
Just on the T-SQL part of this:
if not (a=0 and b=0)
Then leave "else" out of it.
Of course, that will return positive if a equals 0 and b doesn't, or vice...
September 28, 2009 at 3:09 pm
Viewing 15 posts - 8,296 through 8,310 (of 14,953 total)