Viewing 15 posts - 5,911 through 5,925 (of 6,036 total)
master.dbo.xp_cmdshell can take only one string in double quotes. You are trying to pass 3.
You don't need quotes for filename.txt and you can replace long string for bcp.exe with call...
October 6, 2005 at 2:48 pm
1. Add identity or use another column with unique value in it.
2. Create function lioke this:
CREATE FUNCTION dbo.GetInvoiceID (@ModelId char(12), @IdentValue int)
RETURN int
AS
declare @C...
October 6, 2005 at 2:41 pm
Actually in you script you can get rid of the problem by replacing UPDATE with DELETE and INSERT.
Because you are updating all fields you can delete row where id =...
October 6, 2005 at 4:58 am
Select @MyAttachments = '\\genesis\E$\ReportPDF\' + convert(nvarchar(50), OganizationID ) + '\' + convert(nvarchar(50), ProjectID)+ '\' + 'OpenItem.pdf'
from @tempEmail
October 5, 2005 at 6:51 pm
Remove all variables.
update Contact1del
set lastdate = getdate(),
company = deleted.company,
key5 = deleted.key5
FROM deleted
where Contact1del.recid = deleted.recid
Probaby you need and Contact1del.accountno = deleted.acccountno, depending on what...
October 5, 2005 at 5:02 pm
For updating text fields you must use UPDATETEXT.
There is full description and examples of use in BOL.
October 5, 2005 at 4:46 pm
Create 2 procedures.
1st - to check if there are rows with NULL in DATA_1. Set @RETURN_VALUE for this SP according to the result.
You can just RETURN value of (select COUNT(*)...
October 5, 2005 at 4:31 pm
Seems error happens when SQL Server tries to convert string you suplly as a parameter to datetime value.
You must have different date representation formats on the server and on your local...
October 4, 2005 at 10:32 pm
First, you better set up trigger to delete references on all levels to just deleted values on the top level. Otherwise your data does not make any sence.
Second, when you...
October 3, 2005 at 6:10 pm
Where the value you trying to insert comes from?
Application should not invent values in columns referenced by FK, it must retrieve it from DB. That's the only point of FK.
If...
October 3, 2005 at 3:48 pm
SELECT case when ISDATE(Member.Birth_Date) = 1 then CONVERT( smalldatetime, Member.Birth_Date) else 0 end ...
October 3, 2005 at 3:13 pm
SELECT Count(logins)
FROM ....
GROUP BY (DATEDIFF(dd, '2005-07-17', DateOfLogin)/7)
"DateOfLogin" - column in your table
October 3, 2005 at 3:02 pm
My suggession - normalise all addresses.
Create set of tables: Country, State, City, Suburb, Street, StreetType ('Road', 'Street', 'Lane' etc.), Address (having separate fields for house number, unit, block, StreetId), than try...
October 3, 2005 at 2:58 pm
Do your query this way:
SELECT .....
FROM CDX_CompanyDataXX CCD
INNER JOIN .....
INNER JOIN (select MAX(CDX_version) as Max_CDX_version, CDX_COM_id
from CDX_CompanyDataXX
group by CDX_COM_id) M on M.Max_CDX_version = CCD.CDX_version...
October 2, 2005 at 8:02 pm
Create procedure My_proc
as
SELECT * FROM #TempTable
GO
CREATE #TempTable (
Col001 int,
Col001 nvarchar(50)
)
INSERT INTO #TempTable
SELECT (whatever)
EXEC My_Proc
DROP TABLE #TempTable
September 29, 2005 at 4:01 pm
Viewing 15 posts - 5,911 through 5,925 (of 6,036 total)