Viewing 15 posts - 2,521 through 2,535 (of 3,544 total)
As written you must use
EXEC sp_executesql
or do you mean that the sql works with EXEC but not sp_executesql ?
Trigger, yes sp_executesql will cache query plans but if I remember...
Far away is close at hand in the images of elsewhere.
Anon.
October 13, 2004 at 3:04 am
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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)
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
October 6, 2004 at 6:39 am
Plus, it would better written as
IF @NewClosedDetail IS NOT NULL
Far away is close at hand in the images of elsewhere.
Anon.
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)... |
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
October 1, 2004 at 2:16 am
Yes Index Names have to be unique in a database and a Primary Key is an Index.
Far away is close at hand in the images of elsewhere.
Anon.
September 30, 2004 at 7:56 am
LEFT(ISNULL(REPLICATE(@Char2, @n - DATALENGTH(@Char1)),'') + @Char1,(CASE WHEN @n < 0 THEN 0 ELSE @n END))
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
September 29, 2004 at 6:54 am
Viewing 15 posts - 2,521 through 2,535 (of 3,544 total)