Viewing 15 posts - 61 through 75 (of 209 total)
Not sure what your Split function does, so here's a self-contained version which brings all the processing in-line
IF NOT OBJECT_ID('tempdb.dbo.#t', 'U') IS NULL DROP TABLE #t;
SELECT '123; 156' AS StaffNo,...
September 9, 2010 at 5:02 am
Is this what you're looking for?
Declare @staffno varchar(10)
Set @staffno = '156'
SELECT TableName.*, S.Item
FROM TableName
CROSS APPLY dbo.split(staffno, ';') AS S
WHERE S.Item = @staffno
September 9, 2010 at 2:12 am
You could use OPENROWSET BULK to achieve this
IF (SELECT CHARINDEX('Error', BulkColumn) FROM OPENROWSET (BULK 'C:\YourFile.txt', SINGLE_CLOB) AS Z) > 0
SELECT 'ERROR IN FILE'
September 8, 2010 at 3:58 pm
Try this
WITH cteDealer (Dealer_locationid, dealerid, locationid) AS
(
SELECT 1001, 101, 501 UNION ALL
SELECT 1002, 101, 502 UNION ALL
SELECT 1003, 101,...
September 8, 2010 at 2:23 pm
nagarajan.santhan (9/7/2010)
I have a text file having new records with random columns...
say example...
1,LASTNAME,FIRSTNAME,AGE,SEX,DOB
2,LASTNAME,FIRSTNAME
3,LASTNAME,FIRSTNAME,AGE,SEX
4,LASTNAME,FIRSTNAME,AGE,SEX,DOB
5,LASTNAME,FIRSTNAME,AGE
6,LASTNAME
When using BULK INSERT command it says "Bulk insert data conversion error (type mismatch) for row 2,...
September 7, 2010 at 4:26 pm
emily-1119612 (9/7/2010)
I also should have mentioned that not every record would have embedded quotes. The following would be more representative.
"A","Is this a ""valid""...
September 7, 2010 at 11:46 am
vinod.km (9/6/2010)
I have an existing table, which has thousands of records.There is no identity column in this table & I can not modify the existing table structure also. The...
September 6, 2010 at 5:11 pm
Steve Jones - Editor (9/5/2010)
I'm slightly confused. The test you show has datetime values in it. Are you not using date data types and time data types.
steve-893342 (9/4/2010)
SELECT *
FROM...
September 5, 2010 at 1:37 pm
Gordon Barclay (9/5/2010)
SELECT
CONVERT(char(10), YearChar, 103) + ' '+ CONVERT(Char(8), tbl_DateTime.Time,13),
Cast(tbl_DateTime.Time as char(8))
FROM
tbl_DateTime
WHERE
...
September 5, 2010 at 11:33 am
sku370870 (9/5/2010)
If the Inserted and Deleted tables always exist for the duration of a trigger ... if you write a trigger for INSERT, UPDATE and DELETE -...
September 5, 2010 at 5:28 am
Is this what you're looking for?
SELECT *
FROM tbl_DateTime
WHERE CONVERT(DATETIME, YearChar, 103) + Time BETWEEN '20100823 22:00:00' AND '20100824 06:00:00'
September 4, 2010 at 5:54 pm
Precisely, and moreover the way the trigger is written for a DELETE, when the Audit table is populated, the fields ProductID, BatchID, Note, LocationID will always end up as NULL...
September 4, 2010 at 11:49 am
sku370870 (9/4/2010)
But, the code is in a...
September 4, 2010 at 5:11 am
Another approach is to create a function in situ (here called Z) to split the column in to its component parts and then CROSS APPLY against this function which is...
September 4, 2010 at 3:28 am
ackreul (9/3/2010)
September 3, 2010 at 5:46 pm
Viewing 15 posts - 61 through 75 (of 209 total)