Viewing 15 posts - 1,996 through 2,010 (of 2,171 total)
I don't understand. I get 1 and 8,000 as resultsets from above code.
Changing code to
declare @null varchar
set @null = '2'
exec('select 1' + @null)
select len(replicate('x',15456)+replicate('x',160000))
shows 12 and...
July 5, 2006 at 6:34 am
Let's only hope that the birthdates are stored in datetime/smalldatetime field, and not a varchar field.
July 5, 2006 at 4:06 am
select * from mydb..syscolumns where status & 0x80 = 0x80
or
sp_msforeachdb 'select * from ?.dbo.syscolumns where status & 0x80 = 0x80'
July 5, 2006 at 4:02 am
Do you have a unique identity in the table?
Then use
DECLARE @NthRow INT
SELECT @NthRow = 5
SELECT *
FROM YourTable
WHERE YourIdentityColumn % @NthRow = 0
AND YourIdentityColumn > 0...
July 5, 2006 at 12:53 am
declare @db table (id int identity(0, 1), name sysname)
insert @db
(
name
)
select name
from master..sysdatabases
where dbid > 4 -- remove system databases
order by case when name = db_name() then 0 else 1 end
July 4, 2006 at 6:52 am
Is that automatically color-coded or you do do it by hand?
I'd like to know, because some examples I give here needs color-coding.
July 4, 2006 at 5:06 am
It seems that the function returns the same string for every row. If that is the case, store the function string before and update later, as
DECLARE @result VARCHAR(10)
SELECT @result =...
July 4, 2006 at 12:45 am
Here is another approach, which I also believe as faster than Tim's suggestion. Preliminary testing shows that it is 4 times faster.
CREATE FUNCTION dbo.fnTs2Bin8
(
@TS VARCHAR(23)
)
RETURNS BINARY(8)
AS
BEGIN
DECLARE...
July 2, 2006 at 2:13 pm
Das ist ok. Ich werde Ihnen helfen, so viel wie ich kann. Nächste Woche ist mein letzter gewöhnlicher Job Woche vor dem Urlaub. Dann habe ich Urlaub seit 5 Wochen...
July 1, 2006 at 11:54 am
Hello again Thomas!
Here is your solution.
declare @test-2 table (personalid tinyint, name varchar(3), loginid smallint, site varchar(2))
insert @test-2
select 50 ,'Tom', 1234, 'OE' union all
select 50 ,'Tom', 5678,...
July 1, 2006 at 9:38 am
I thought the idea was to return to ID where there was discrepancy, not the fk itself.
My mistake. You have written an awsome query! Now it is mine turn to...
June 30, 2006 at 7:18 am
Doesn't it only calculate if the number of fk for each id is different?
What if ID 1 has fk 3 and 4, while ID 2 has fk 3 and 5?...
June 30, 2006 at 7:02 am
Well. That is something I don't se very often these days. An ID storage table. So I don't know if you benefit from my suggestions, but here is a SET-based...
June 30, 2006 at 6:17 am
Viewing 15 posts - 1,996 through 2,010 (of 2,171 total)