Viewing 15 posts - 2,521 through 2,535 (of 3,543 total)
Not really done much with UDF's or returning tables from them but you could return the error in the output table like this
Create Function dbo.FnGetDateDiffs2
(@StartDate DATETIME, @EndDate DATETIME)
RETURNS @retElapsed TABLE...
October 12, 2004 at 7:33 am
In addition to what has been stated, with the DDL posted, only Place_ID can be part of a primary key as all columns in a primary key have to be...
October 12, 2004 at 7:18 am
Not pretty but.....
DECLARE @value char(7)
SET @value = '000123Y'
SELECT SUBSTRING('0-',PATINDEX('%[A-Z]%',SUBSTRING(@value,7,1))+1,1)
+ SUBSTRING(@value,1,5)
+ '.'
+ SUBSTRING(@value,6,1)
+ SUBSTRING('01234567890123456789',CHARINDEX(SUBSTRING(@value,7,1),'0123456789.......GTY'),1)
you can use the result as is or CAST it if...
October 12, 2004 at 6:37 am
Without using a function but using a while loop
make sure ConCatField is NULL before running this
DECLARE @upd int
SET @upd = 1
WHILE (@upd > 0)
BEGIN
UPDATE t
SET...
October 6, 2004 at 7:33 am
Or
STUFF(STUFF('06102004',5,0,'.'),3,0,'.')
and to type datetime
CAST(STUFF(STUFF('06102004',5,0,'.'),3,0,'.') as datetime)
October 6, 2004 at 6:52 am
Cannot remember if the error number is the same but I sometimes get the dts message and step failed if there is a data conversion problem (ie date). If the...
October 6, 2004 at 6:39 am
Plus, it would better written as
IF @NewClosedDetail IS NOT NULL
October 5, 2004 at 7:03 am
![]() | export (dts) the table data to a new (temp) table and then truncate the original before importing (dts)... |
October 5, 2004 at 5:14 am
I agree with hoo-t
We had the same problem with one server and successfully rebuilt master and changed the collations of the database.
There is a bug with rebuildm, see
http://support.microsoft.com/default.aspx?scid=kb;en-us;273572
October 1, 2004 at 2:23 am
You need to add this line
SET @MRevAmount = null
before
select @MRevAmount = MonthlySumRev, @QTRevAmount = QuarterTotRev, @QARevAmount = QuarterAvgRev
from ##TEMPTOTALS where organizationid=@OrganizationID and [Year]=@Year and [Month]=@Month
because if there is...
October 1, 2004 at 2:16 am
Yes Index Names have to be unique in a database and a Primary Key is an Index.
September 30, 2004 at 7:56 am
LEFT(ISNULL(REPLICATE(@Char2, @n - DATALENGTH(@Char1)),'') + @Char1,(CASE WHEN @n < 0 THEN 0 ELSE @n END))
September 30, 2004 at 7:00 am
When you renamed the table the priamry key will remain with the table and have the same name when it was created (either by the system or by you). Names...
September 30, 2004 at 6:19 am
Look up sp_fkeys in BOL (Books Online)
This will produce sql to find foreign keys in current database
SELECT 'exec sp_fkeys '+name FROM sysobjects WHERE type = 'u'
copy and paste results into...
September 29, 2004 at 6:54 am
SELECT * FROM
OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\temp\book1.xls', [sheet1$])
September 29, 2004 at 6:35 am
Viewing 15 posts - 2,521 through 2,535 (of 3,543 total)