Viewing 15 posts - 316 through 330 (of 683 total)
For the same reason these aren't...
select cast(24 - 7 - 2006 as datetime)
select cast(-1989 as datetime)
Maybe one of these is what you're after...
select replace(convert(varchar(30),...
July 24, 2006 at 5:55 am
Have you tried sp_update_job? e.g.
EXEC sp_update_job @job_name = 'My Job', @enabled = 0
July 24, 2006 at 5:50 am
Something like this?
--data
declare @t table (MAJOR int, MINOR char(4), PRODMGR char(2), CST_USD int, REV_USD int, LCTRYNUM int, AMT_TYPE char(1))
insert @t
select 538, '1616', 'LN', 0, 250,...
July 24, 2006 at 5:24 am
> Couldn't I do this without declaring a new table and just use the value from the already existing table?
Yes. Exactly that. My "example data" was...
July 20, 2006 at 8:32 am
So you just want to set a variable with a value that's in a table? That simple? If so, here's an example...
--example data
declare @t table (id...
July 20, 2006 at 3:30 am
It's not clear to me what you're asking.
If you are loading data from a file, but want that data to be slightly different in the table you're loading it to, then first...
July 19, 2006 at 10:00 am
You can cast it as a decimal...
declare @x float
set @x = 88.125
select @x, cast(@x as decimal(8, 2))
July 19, 2006 at 9:55 am
By the way, to fix Jules' code, we just need the datatype of usertext to be varchar rather than char in the table (or to add an rtrim to the...
July 19, 2006 at 6:00 am
Jules - I have similar problems getting the code working. It's not important, however, since I am familiar with that method and I understand the idea.
This article and subsequent comments mention...
July 19, 2006 at 4:43 am
This looks like a pivot/crosstab request, and there are several articles out there on the subject.
I recommend you take a look at them...
http://www.sqlservercentral.com/columnists/plarsson/pivottableformicrosoftsqlserver.asp
http://www.sqlteam.com/item.asp?ItemID=2955
http://weblogs.sqlteam.com/jeffs/archive/2005/05/02/4842.aspx
July 18, 2006 at 5:56 am
Well, with your example you can do this...
CREATE PROCEDURE sp_test
AS
SELECT 55
SELECT 'xx'
GO
CREATE TABLE #tblTest (v sql_variant)
INSERT INTO #tblTest EXEC sp_test
SELECT v, SQL_VARIANT_PROPERTY (v, 'BaseType') as 'BaseType'...
July 18, 2006 at 5:21 am
Or...
--data
create table users (UserId tinyint, usertext varchar(50))
insert users
select 1, 'ABC'
union all select 1, 'DEF'
union all select 2, 'ABC'
union all select 3, 'ABC'
union all select 3,...
July 18, 2006 at 5:09 am
I've just written this, and then just read Dan's post. I've assumed messageid is an identity, but have not assumed records are entered in date order.
I guess use the one...
July 17, 2006 at 10:32 am
I agree with Ray, but for what it's worth...
--preparation (adapted from http://www.mindsdoor.net/SQLTsql/ParseCSVString.html)
create function fn_ParseCSVString (@CSVString varchar(8000), @Delimiter varchar(10))
returns @tbl table (row int identity(1, 1), s...
July 13, 2006 at 11:34 am
I'm with Phil.
If it's about comparing all the columns, you can do something along the lines of...
--data
declare @t table (a int, b int, c int)
insert @t
...
July 13, 2006 at 10:04 am
Viewing 15 posts - 316 through 330 (of 683 total)