Viewing 15 posts - 31 through 45 (of 82 total)
From SQl Books on Line:
----
int, bigint, smallint, and tinyint
Exact number data types that use integer data.
bigint
Integer (whole number) data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). Storage size is 8 bytes.
int
Integer...
August 29, 2003 at 3:11 am
declare @table1 table ([Day] int,[Count] int)
declare @table2 table (day1 int, day2 int, day3 int, day4 int, day5 int)-- etc...
insert into @table1
select day(callwhen) as day,
count(day)
from billable_transactions
group by day(callwhen)...
August 28, 2003 at 6:55 am
The way we commonly use is a UDF function (provided you are on SQL2000) that will take in a list of values, in our case we pipe delimit them, and...
August 27, 2003 at 9:21 am
... Also if you look at the definition of SmallDateTime in Books On Line, you will see it is not what you are after.
August 26, 2003 at 6:43 am
Another suggestion to return what you want. Replace GetDate() with your datetime value.
select stuff(convert(varchar,getdate(),101),7,2,'')
select stuff(convert(varchar,getdate(),103),7,2,'') + ' ' + substring(convert(varchar,getdate(),113),13,5)
Basically have a look at Convert in Books on line, and...
August 26, 2003 at 6:34 am
Deleting all contents of a table: I would have thought truncate would be the fastest way as it does not log much in the transaction log, unlike a delete statement:
Truncate...
August 14, 2003 at 7:45 am
August 11, 2003 at 5:12 am
You cannot pass a field name into a select using a variable.
One solution would be to pass it in to a dynamic select statement:
declare @sql varchar(8000)
August 8, 2003 at 9:40 am
That sounds just like an error you get if you call:
Exec @sql
rather than
Exec (@SQL)
Are you doing it with brackets?...
August 7, 2003 at 10:29 am
Hot summers day, not much else on:
create function dbo.MaxChoice (@Choices varchar(8000))
returns int
as
begin
declare @Pos int
declare @MaxChoice int
declare @WorkingChoice int
set @Choices = @Choices + ','
while len(@Choices) > 0
begin
set @pos = charindex(',',@Choices)
set @WorkingChoice...
August 7, 2003 at 9:23 am
As far as I know, you cannot use a goto in a select statement.
As you are not selecting data from a table, try just using an if statement:
If @name =...
August 7, 2003 at 8:58 am
Replace varchar(12) to varchar(15) in last post.
July 25, 2003 at 8:56 am
dynamically add zeros:
declare @String varchar(15)
set @String = '123'
select convert(varchar(12),(replicate('0', (12 - len(@String))))) + cast(@String as varchar(12))
returns 000000000123 etc..
July 25, 2003 at 8:55 am
UPDATE tblProtocol
SET tblProtocol.tblSponsorFK = [tblSponsor]![tblSponsorPK]
from tblProtocol
INNER JOIN tblSponsor ON tblProtocol.tblSponsorFK = tblSponsor.SponsorID
July 24, 2003 at 7:47 am
Using cast will convert it to a varchar, however even varchar datatype's will return 1 to a isnumeric() if it can evaluated into a number. Casting it to a varchar...
July 24, 2003 at 6:50 am
Viewing 15 posts - 31 through 45 (of 82 total)