Viewing 15 posts - 451 through 465 (of 596 total)
If the text columns contain text less than 8000 characters in length, you could convert to varchar, like this:
UPDATE Contacts
SET memo = CONVERT(varchar(8000), cct.TextTransfer) + ' ' + CONVERT(varchar(8000),...
December 30, 2004 at 10:57 am
Are all of the columns you are concatenating of type char or varchar? Numeric types will have to be converted (using CONVERT or CAST) to a character type.
For example, if...
December 30, 2004 at 5:59 am
To add a SQL Server login, refer to:
sp_addlogin [ @loginame = ] 'login'
[ , [ @passwd = ] 'password' ]
[ , [ @defdb = ] 'database' ]
[...
December 29, 2004 at 6:42 am
I think you've made your code unnecessarily complex. It seems as though you should be able to set @txtToAdd with this query:
SELECT @txtToAdd = 'Transfer Date: ' + udfv.fieldvalue
FROM UserDefinedFieldvalue...
December 29, 2004 at 6:15 am
To correct your correlated subquery, you would do the following:
UPDATE Objects
SET SerialNumber =
(SELECT SerialNumber
FROM temp1
WHERE temp1.un_id = objects.Un_ID
)
This particular WHERE clause...
December 29, 2004 at 5:59 am
December 28, 2004 at 8:11 am
I'm sorry, I didn't intend to be unkind with my remarks. I was just trying to provide an alternative that works better for me. Most code has limitations of some kind.
Happy...
December 27, 2004 at 8:49 am
Frank is correct. The question was how to add 1 (second) to
select datepart(second,Getdate())
which returns an integer whose units are seconds. Thus,
SELECT DatePart(s, Getdate()) + 1
If the problem is how...
December 27, 2004 at 7:25 am
I agree with Slawomir Mucha. Also, if the occurrence number provided exceeds the number of substrings, the last substring is returned. I prefer to return an empty string in those...
December 27, 2004 at 7:14 am
When you execute the batch from xp_cmdshell, the batch file is run in the security context of the SQL Server service login id.
Another problem is that the H: drive mapping...
December 23, 2004 at 9:35 am
To output the results of a query with bcp, you need to fully qualify the table name in your query:
bcp "Select * from TEST.dbo.users" queryout H:\TESTSHARE\Test.tb2 -c -S"MAHESH" -T
or
bcp "Select...
December 22, 2004 at 6:00 am
I'm not sure if this will help, but here's a script I wrote, followed by a bunch of examples:
DROP FUNCTION dbo.FormatDec
GO
CREATE FUNCTION dbo.FormatDec
(
@num decimal(38,4),
@decPlaces int
)
RETURNS varchar(20)
AS
BEGIN
DECLARE @cnum...
December 21, 2004 at 8:20 am
Steve meant to say "clear the checkbox" for set quoted identifier. When "set quoted identifier" is on, double quotes indicate column names. I always use single quotes for string constants...
December 16, 2004 at 6:38 am
If you just want to sum the maximum lengths of all the column in a table, you could something like this:
DECLARE @tableName varchar(128)
SET @tableName = '<your table>'
SELECT Sum(c.length) as MaxDataBytes
...
December 15, 2004 at 6:13 am
Viewing 15 posts - 451 through 465 (of 596 total)