Viewing 15 posts - 1,966 through 1,980 (of 3,543 total)
Just to pitch in
SELECT CAST([columnname] as varbinary(8000))
will display the string in hex and you can see what and how many non printable...
March 7, 2006 at 6:56 am
CREATE TABLE #temp (location int, [name] varchar(40), DOB datetime)
INSERT INTO #temp (location, [name], DOB)
SELECT location, [name], DOB
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;HDR=YES;Database=C:\temp\book1.xls', [sheet1$])
DECLARE @location int
SELECT @location =...
March 3, 2006 at 7:34 am
or use BCP
exec master..xp_cmdshell 'bcp database.owner.tablename out outputfilename -c -t "," -S servername -T'
March 3, 2006 at 7:24 am
in TSQL
INSERT INTO
OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;HDR=YES;Database=C:\temp\book2.xls', [sheet1$])
(location, [name], DOB)
SELECT location, [name], DOB
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;HDR=YES;Database=C:\temp\book1.xls', [sheet1$])
WHERE location = 'locationwanted'
the only caveat with this method is...
March 3, 2006 at 7:13 am
Try this
osql -S <server> -E -b -m-1 -i <not_changeable_sql_script.sql> -o <output>
IF ERRORLEVEL 1 GOTO ERROR_LABEL
March 3, 2006 at 7:01 am
![]() | ...but your solution uses some implicit assumptions that are not given ... |
But your observations are assumptions also,...
March 1, 2006 at 3:52 pm
UPDATE a
SET a.[Scheduled Amount] = a.[Scheduled Amount] + CASE WHEN (@Qty - b.Summ) > (a.Quantity - a.[Scheduled Amount]) THEN (a.Quantity - a.[Scheduled Amount]) ELSE (@Qty - b.Summ - a.[Scheduled...
March 1, 2006 at 9:06 am
No problem
I had to look twice myself just to make sure
March 1, 2006 at 8:37 am
![]() | A little tweak to seems (to me) to meet all the requirements (including the priority one)... |
My solution...
March 1, 2006 at 8:22 am
a possible solution
DECLARE @Material NVarChar(32), @Qty int
SET @Material = 'MATERIAL1'
SET @Qty = 350
UPDATE a
SET a.[Scheduled Amount] = CASE WHEN (@Qty - b.Summ) > a.Quantity THEN a.Quantity ELSE (@Qty -...
March 1, 2006 at 7:16 am
Just guessing but I think the problem is the join between PartRace and IndResults not matching on RaceID
SELECT p.ParticipantID, pr.Age, ir.FnlTime, e.EventDate
FROM Participant p...
March 1, 2006 at 6:26 am
Could use if int (if not int then STR will round)
REPLACE(STR(Amount,13,0),' ','0')
or with decimal point
REPLACE(STR(Amount,13,2),' ','0')
or without decimal point but including decimal part
STUFF(REPLACE(STR(Amount,14,2),' ','0'),12,1,'')
February 28, 2006 at 7:23 am
If the fields are varchar then
create the numbers table thus
CREATE TABLE [numbers] (number int PRIMARY KEY CLUSTERED)
and populate with numbers from 1 to 8000
and use
DECLARE @result varchar(8000)
SET @result...
February 28, 2006 at 7:13 am
The same without nesting
CASE
WHEN IsPage=1 THEN 'Page'
WHEN IsFolder=1 THEN 'Folder'
WHEN ISMenu=1 THEN 'Menu'
ELSE 'Unknown'
END
February 28, 2006 at 6:39 am
Viewing 15 posts - 1,966 through 1,980 (of 3,543 total)