Viewing 15 posts - 1 through 15 (of 21 total)
declare @t table (ID int, Cost int, ItemNumber nvarchar(2))
insert into @t
select 1, 50, 'A' union all
select 1, 40, 'A' union all
select 1, 50, 'B' union all
select 2, 30, 'D' union...
October 23, 2009 at 11:01 am
declare @test-2 varchar(20)
set @test-2 = '09-06-2005 00:00:00'
select datediff(month, cast(@test as datetime),getdate())
select cast(@test as datetime)
October 23, 2009 at 9:04 am
The only thing I can think of is using a trigger to update that field after insert
update query:
--drop table #t
create table #t (spaces nvarchar(9))
insert into #t
select 'me' union all
select 'you'...
October 15, 2009 at 1:24 pm
I don't think this is pretty but it works
declare @date datetime
declare @prodid nvarchar(20)
declare @m nvarchar(2)
declare @y nvarchar(4)
set @prodid = 'prod1'
set @y = 2009
set @m = 3
set...
October 15, 2009 at 10:30 am
r_prasanna82 (9/15/2009)
The format from the source is mm/dd/yyyy time.
YYYY-MM-DD
(DB_DATE)(SUBSTRING(columnname, 7,4) + '-' + SUBSTRING(columnname, 1,2) + '-' + SUBSTRING(columnname, 4,2) )
September 15, 2009 at 1:56 pm
Example for Row_Number Function
declare @t table (name nvarchar(10), tn nvarchar(10), date datetime)
insert into @t
select 'matt','1234567890','2009-09-15' union all
select 'john','2345678901','2009-05-15' union all
select 'pete','','' union all
select 'matt', '2345678901','2009-04-18' union all
select 'john','7890123456','2009-09-15'
select name, tn...
September 15, 2009 at 12:52 pm
My understanding is that your user variable "Path" is being filled with a value like: "\\serverA\folder1\folder2"
and your user variable "Path" is the variable being used in the second foreach loop...
September 9, 2009 at 11:43 am
I left the folder field in the enumerator configuration of For Each loop container empy.
It is okay for this to be empty, by setting the directory property with the variable...
September 9, 2009 at 11:28 am
I left the folder field in the enumerator configuration of For Each loop container empy.
It is okay for this to be empty, by setting the directory property with the variable...
September 9, 2009 at 11:26 am
Everything that I gave you is based off of your first foreach loop,
put in a breakpoint and see if the mapped variable in the first loop is being filled
September 9, 2009 at 11:21 am
right click on the filesystems task and set the property "delay validation" = true
September 9, 2009 at 10:44 am
If you want to delete every text file in the folder you can:
Insert another foreach loop container inside of the one you have now
Set your "Enumerator" = Foreach File Enumerator
Open...
September 9, 2009 at 10:13 am
I fixed my previous query:
drop table #t1
go
create table #t1
(
RowId integer,
SomeName nvarchar(6),
ValueStr nvarchar(50)
)
go
insert into #t1 values(1,'giri','1,2,3')
insert into #t1 values(2,'nani','1,2')
drop table #t2
go
create table #t2
(ID int,
Alpha varchar(1))
go
insert into #t2 values(1,'a')
insert into #t2 values(2,'b')
insert...
September 9, 2009 at 9:23 am
This worked out well:
drop table #t1
go
create table #t1
(
RowId integer,
ValueStr nvarchar(50)
)
go
insert into #t1 values(1,'1,2,3')
insert into #t1 values(2,'2')
insert into #t1 values(3,'2,3')
insert into #t1 values(4,'2')
drop table #t2
go
create table #t2
(ID int,
Alpha varchar(1))
go
insert into...
September 9, 2009 at 7:49 am
Or,
If you are not sure where you need the space you could search for ',%'
DECLARE @SQLTEXT Table(SQLText ntext)
INSERT INTO @SQLTEXT Values('usp_CheckWeeklyResponseTeam %BD%, %ED%, %S%, %F%,%D%, %V%')
Select SQLTEXT , REPLACE(CONVERT(varchar(max),SQLTEXT),',%',',...
September 8, 2009 at 2:49 pm
Viewing 15 posts - 1 through 15 (of 21 total)