Viewing 15 posts - 1,951 through 1,965 (of 3,544 total)
Just as an exercise thought I'd try this as an exercise
CREATE FUNCTION dbo.udf_Test (@value varchar(100))
RETURNS varchar(100)
AS
BEGIN
DECLARE @result varchar(100)
SET @result = ''
SELECT...
Far away is close at hand in the images of elsewhere.
Anon.
March 23, 2006 at 7:32 am
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...
Far away is close at hand in the images of elsewhere.
Anon.
March 15, 2006 at 7:07 am
No SQL Server equivalent but you could use
DECLARE @sql varchar(8000)
SET @sql = ''
SELECT @sql = @sql + 'GRANT SELECT,INSERT,UPDATE,DELETE ON [' + TABLE_NAME + '] TO myuser;'
FROM...
Far away is close at hand in the images of elsewhere.
Anon.
March 15, 2006 at 6:41 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...
Far away is close at hand in the images of elsewhere.
Anon.
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... |
Far away is close at hand in the images of elsewhere.
Anon.
March 14, 2006 at 9:05 am
SELECT COALESCE([Last Name] + ', ' + [First Name], [Last Name], [First Name]) as [Name]
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
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))...
Far away is close at hand in the images of elsewhere.
Anon.
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'
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
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] +...
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
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.
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
March 7, 2006 at 7:21 am
Viewing 15 posts - 1,951 through 1,965 (of 3,544 total)