Viewing 15 posts - 1,951 through 1,965 (of 3,543 total)
or
declare @cmd varchar(300)
declare @user varchar(30)
set @user='loginname'
select @cmd = 'SELECT DISTINCT ''?''
FROM master.dbo.syslogins l
inner join [?].dbo.sysusers o ON o.sid = l.sid
WHERE o.name = ''' + @user...
March 15, 2006 at 7:07 am
ConnectionTimeout is for timeout on connecting to SQL Server what you want is CommandTimeout, which is in seconds and has a default of 30.
Set CommandTimeout to just above the longest query...
March 15, 2006 at 2:41 am
![]() | To satisfy my requirement, all I need is to get this result set stored via a cursor/local variable... |
March 14, 2006 at 9:05 am
SELECT COALESCE([Last Name] + ', ' + [First Name], [Last Name], [First Name]) as [Name]
March 14, 2006 at 6:51 am
SELECT (SELECT COUNT(*) FROM tb_hiter e2 WHERE e2.sn <= e.sn AND e2.na = 5940)
AS rownumber, sn
FROM tb_hiter e
WHERE e.na = 5940
ORDER BY sn
March 14, 2006 at 6:42 am
yes
prob with my solution
revised
better to put options in permanent table
CREATE TABLE [Priorities] ([ID] int, field char(50))...
March 10, 2006 at 7:51 am
Try
set @Body = 'Alert Mail – I (MIS) Progress Report to the Client First Reminder ' + CHAR(13) + CHAR(10)
set @Body = @Body + CHAR(13) + CHAR(10) + 'ddfd'
March 10, 2006 at 6:50 am
CREATE FUNCTION dbo.udf__Test_Act_ind (@field_1 char(50),@field_2 char(50))
RETURNS int
AS
BEGIN
DECLARE @id int
SET @id = 0
DECLARE @combinations TABLE ([ID] int, field char(50))
INSERT INTO...
March 10, 2006 at 6:45 am
Well, if we are playing then
SELECT
REVERSE(ISNULL(PARSENAME(REVERSE(REPLACE(FullName,' ','.')),1),'')),
REVERSE(ISNULL(PARSENAME(REVERSE(REPLACE(FullName,' ','.')),2),'')),
REVERSE(ISNULL(PARSENAME(REVERSE(REPLACE(FullName,' ','.')),3),''))
FROM @FullName
March 9, 2006 at 7:52 am
Notwithstanding the above
CREATE FUNCTION dbo.udf_itinerary (@TicketID int, @BookingNo int)
RETURNS varchar(8000)
AS
BEGIN
DECLARE @itinerary varchar(8000)
SET @itinerary = ''
SELECT @itinerary = @itinerary + i.[From] +...
March 9, 2006 at 7:25 am
Add Language=x to the connection string where x is the sql language e.g.
Italian is dd/mm/yyyy
English is mm/dd/yyyy
British English is dd/mm/yyyy
March 8, 2006 at 8:16 am
Check the language for the login and for the server (Default Language) as this affects the way dates are converted.
If possible use yyyymmdd format or SET DATEFORMAT as already mentioned.
March 8, 2006 at 6:51 am
SELECT
REPLACE(CONVERT(varchar,CAST(ColA as money),1),'.00',''),
REPLACE(CONVERT(varchar,CAST(ColB as money),1),'.00',''),
REPLACE(CONVERT(varchar,CAST(ColC as money),1),'.00',''),
CONVERT(varchar,CAST(ROUND(ColD,2,1) as money),1)
FROM [TableName]
Beware of rounding
SELECT CONVERT(varchar,CAST(1.6075 as money),1)
Result: 1.61
SELECT CONVERT(varchar,CAST(ROUND(1.6075,2,1) as money),1)
Result: 1.60
March 7, 2006 at 7:21 am
Beware of rounding, ie
DECLARE @number numeric(9,5)
SET @number = 60.99999
SELECT @number,CAST(@number AS numeric(6, 2))
result
60.99999 61.00
SELECT @number,CAST(ROUND(@number,2,1) AS numeric(6, 2))
result
60.99999 60.99
March 7, 2006 at 7:05 am
Viewing 15 posts - 1,951 through 1,965 (of 3,543 total)