Viewing 15 posts - 13,921 through 13,935 (of 14,953 total)
Separate table per constant type is the way I go on this.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 1, 2008 at 8:18 am
Have you tried using the char value?
select *
from table
where column like '%' + char(0xA3) + '%'
I just tried this:
create table #Test (
ID int identity primary key,
Val char(1))
insert into #test (val)
select...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 1, 2008 at 8:14 am
When you want to use a variable in a Like statement, use this:
where Column like '%' + @variable + '%'
Otherwise, the way you wrote it, it's looking for the string-literal...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 1, 2008 at 8:09 am
Late to the game, but here's what I came up with for least common multiple:
declare @N1 int, @N2 int
select @n1 = 1513, @n2 = 52
;with
N1 (N1Multiple) as
(select @n1 *...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 1, 2008 at 8:01 am
I just tried that script, and it seems to work for me. Maybe you need to use Execute As?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 1, 2008 at 7:10 am
RonKyle (5/1/2008)
In the example above, the four tables I showed with a natural key have 3, 17, 12 and 9 rows respectively. When I got here a year ago, the...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 1, 2008 at 6:58 am
I agree with Grant. Store them in a table and join to it.
UDF in Where will slow your code down. Even if it's by a small amount, it's...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 1, 2008 at 6:53 am
I doubt it's something specific to Access on top of SQL. I administered an Access app on top of SQL Server for 6 years, and the only time identity...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 30, 2008 at 2:44 pm
Prefer numeric keys over text keys.
I have listened to many arguments in support of that rule. I remain unconvinced.
The only reason I can think of for this is that numeric...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 30, 2008 at 2:37 pm
There also seems to be this idea floating about that if one finds an exception to a rule, then the rule is no good.
Bloody hell!
The idea that rules with exceptions...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 30, 2008 at 2:23 pm
It depends on what you're copying and what front-end you have on the database.
For example, in MS Access, which can be used as a front end for SQL Server databases,...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 30, 2008 at 1:48 pm
select dateadd(day, YourDayValue-1, dateadd(month, YourMonthValue-1, dateadd(year, YourYearValue-1900, 0)))
or
select cast(cast(YourMonthValue as varchar(2)) + '/' + cast(YourDayValue as varchar(2)) + '/' +
cast(YourYearValue as char(4)) as datetime)
or
select cast(cast(YourYearValue as char(4)) + right('00' +...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 30, 2008 at 1:23 pm
I just tested this:
create table #Test (
ID int identity primary key,
Cash money,
DecCash decimal(15,5))
insert into #test(cash, deccash)
select cast(n1.number as money) + cast(n2.number as money)/100.00,
cast(n1.number as decimal(15,5)) + cast(n2.number as decimal(15,5))/100.00
from...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 30, 2008 at 1:14 pm
Can you have a table with columns for each of the characteristics you need, and leave some of them null, and have a type column in that table, and some...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 30, 2008 at 1:02 pm
Tomm Carr (4/29/2008)
GSquared (4/29/2008)
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 30, 2008 at 12:53 pm
Viewing 15 posts - 13,921 through 13,935 (of 14,953 total)