Viewing 15 posts - 46 through 60 (of 248 total)
declare @table table
(ID_VAL INT identity(1,1),
Date_Field Datetime
)
insert into @table values ('02/12/2006')
insert into @table values ('02/13/2006')
insert into @table values ('02/14/2006')
insert into @table values ('02/15/2006')
insert into @table values ('02/17/2006')
insert into @table values ('02/19/2006')
insert...
March 3, 2006 at 10:39 am
declare @Delete_Dup_Records table
(
id_val INT IDENTITY(1,1),
vid int,
vName varchar(50),
vAddress varchar(40),
VGroup char(1) default 'N' not null
)
INSERT INTO @Delete_Dup_Records (VID, VNAME, VADDRESS, VGROUP) SELECT VID, VNAME, VADDRESS, VGROUP FROM Delete_Dup_Records
PRINT '**************'
PRINT 'BEFORE DELETE'
PRINT...
March 2, 2006 at 6:41 am
Use a CASE conditional statement instead (if is not allowed in the select statement), example:
CASE tbldatatablenew.custtype when 'xyz' then ImageItems else 0 end)
You can also do:
CASE
WHEN col1 = 'Y' then...
March 1, 2006 at 8:53 am
QA (in SQL 2000) is typically good for most people. SQL 2005 has an even better tool SSMS (SQL Server Management Studio). If you are looking for third party tools,...
March 1, 2006 at 8:50 am
It is a scope thing...if you create the temp table like this, it will be visible only within that scope of execution, example:
SET NOCOUNT ON
DECLARE @sql as nvarchar(4000), @table_name1...
February 22, 2006 at 6:21 am
Why do you need to incorporate all of them in the list ? If they select a particular employee, you filter by it, if they select the static list of...
February 20, 2006 at 2:01 pm
A better option would be to use DTS to dump the data into a text file (this will be pretty fast) and then load into Oracle using sql *ldr (either...
February 20, 2006 at 10:00 am
declare @table table (col1 varchar(50))
insert into @table values ('2006-02-10T17:30:00.0000000-00:00')
select col1 original, cast(substring(replace(col1, 'T', ' '), 1, 19) as datetime) new
from @table
original new
-------------------------------------------------- ------------------------------------------------------
2006-02-10T17:30:00.0000000-00:00 2006-02-10 17:30:00.000
(1 row(s) affected)
February 17, 2006 at 6:30 am
Why not use DTS or Bulk insert to do this ? Even if modifications are required after loading of the data, you can have a staging table to load this...
February 17, 2006 at 6:11 am
Search for OpenXML on this site and you wil get some very good articles on how to do this - infact, there have been some recent articles which talk about...
February 16, 2006 at 11:01 am
You can write a function that goes through the string one character at a time, does a isnumeric() check on it - if it is 0, then replaces it with...
February 15, 2006 at 3:04 pm
Except for a lightweight trace, there is no way to know that in SQL Server 2000 (not sure about SQL 2005). Oracle does have a nice feature to flag the...
February 14, 2006 at 9:22 am
Q1) :
Why are you storing them separately rather than a single column ?
Looks like you have those stored in string data-types...there are couple of ways of doing this:
DECLARE @DOB TABLE...
February 9, 2006 at 11:59 am
SQL Server MVP Erland Sommarskog has posted a solution for this on his site..actually a couple of solutions:
http://www.sommarskog.se/arrays-in-sql.html#iterative
February 8, 2006 at 5:06 pm
Viewing 15 posts - 46 through 60 (of 248 total)