Viewing 15 posts - 46 through 60 (of 298 total)
Also if it's not created with UNIQUE the DB engine adds a 4 byte uniqueifier column. You can't see this column.
July 24, 2009 at 6:08 am
Try something like this
DECLARE @d AS VARCHAR(50)
SET @d = '26/05/2009 15:15:15'
SELECT CONVERT(DATETIME,SUBSTRING(@d,1,10),103)
The 103 tells convert the format of the date.
But notice that in your example data the length in the...
July 23, 2009 at 7:05 am
I don't think you can do that because you would have a gap in the LSN sequence (the Log chain).
July 23, 2009 at 6:22 am
Hmm - staging table?
It does open up all of the functionality of SQL. My 2p. I often see requirements that are not fully scoped out or that are likely...
July 22, 2009 at 12:18 pm
I would probably load the file to a staging table and then perform the insert/update in a stored proc.
The stored proc would have 2 statements. In the stored proc I...
July 22, 2009 at 10:55 am
Hmm - makes sense.
Thanks Phil
July 22, 2009 at 5:14 am
Hi Phil,
Thanks! That sorted it. I found one of your code snippets on this site that used the VariableDispenser to read a row and it was simple to switch it...
July 22, 2009 at 4:11 am
Probably no need for NULL check because
DECLARE @i AS INT
SELECT @i = COUNT(*) FROM sys.columns WHERE 1 = 0
SELECT @i
Returns 0
but no bad thing to mention our friend/enemy...
July 21, 2009 at 1:32 pm
More like this (on sql 2005)
DECLARE @i AS INT
SELECT @i = COUNT(*) FROM sys.columns WHERE object_id = 8
SELECT @i -- lets see the result
July 21, 2009 at 1:18 pm
Great - I think you answered the question!
July 21, 2009 at 12:42 pm
Hi Ryan,
Something like this where @YouVar is the variable with your count
DECLARE @MessageBody AS VARCHAR(255)
SET @MessageBody = 'Contains ' + @YourVar + ' records'
EXEC msdb.dbo.sp_send_dbmail
@recipients=N'ryan@test.com',
@subject ='Test Message Subject',
@profile_name ='Ryan_Test'
@body =...
July 21, 2009 at 10:57 am
Viewing 15 posts - 46 through 60 (of 298 total)