Viewing 15 posts - 2,596 through 2,610 (of 3,543 total)
DECLARE @sql nvarchar(100)
SET @sql = 'DECLARE cr CURSOR FOR SELECT * FROM ' + @tname
EXEC (@sql)
OPEN cr
CLOSE cr
DEALLOCATE cr
June 17, 2004 at 6:01 am
If you want to use text for the output because the concatenation will be greater than 8000 then you will not be able to achieve this in a single query.
A...
June 16, 2004 at 6:34 am
SELECT c.CurrencyRateCode, SUM(ISNULL(m.Match,0))
FROM (SELECT DISTINCT CurrencyRateCode FROM CurrencyRates) c
LEFT OUTER JOIN (SELECT CurrencyRateCode,1 AS Match
FROM CurrencyRates
WHERE DATEADD(month,RateMonth-1,DATEADD(year,RateYear-1900,''))
BETWEEN @StartDate AND @EndDate ) m
ON m.CurrencyRateCode =...
June 15, 2004 at 7:23 am
OK some simple instructions to get you going
In EM (Enterprise Manager), expand your server
Select your target database
Right click on the target database, select All Tasks, Import Data
You will then...
June 14, 2004 at 7:08 am
Default Language is per login. Look under Security / Logins in EM. You can change the value there as well.
June 14, 2004 at 7:01 am
ps
To answer your question, the following is from BOL
Values with the datetime data type are stored internally by Microsoft SQL Server as two 4-byte integers. The first 4 bytes store...
June 14, 2004 at 6:57 am
This will give you the start and end datetime for 10 intervals from the start datetime
declare @start datetime,@interval int
set @start = '2004-01-02 21:12:58.000'
set @interval = datediff(ms,'','1900-01-01 01:23:34')
select...
June 14, 2004 at 6:53 am
SELECT A.FORMTITLE, B.COLNAME, A.HTML
FROM DBO.SMSYSBASEVIEWDATA B
INNER JOIN DBO.NAMSYSHTMLFORMS A
ON A.HTML LIKE '%<INPUT id=' +
CAST(B.COLNAME as varchar) +
' % DEType="' +
CAST(B.DEType as...
June 14, 2004 at 2:24 am
I have had some success with these two queries
SELECT *
FROM OpenQuery( ADSI,'<GC://xxx.co.uk>;(&(objectCategory=person)(objectClass=user));cn,distinguishedName,name,givenName,sn,sAMAccountName,department,mail,adspath;subtree')
SELECT cn,distinguishedName,name,givenName,sn,sAMAccountName,department,mail,adspath
FROM OPENQUERY(ADSI,
'SELECT cn,distinguishedName,name,givenName,sn,sAMAccountName,department,mail,adspath
FROM ''LDAP://servername'' WHERE objectCategory = ''CN=Person,CN=Schema,CN=Configuration,DC=xxx,DC=co,DC=uk'' AND objectClass= ''user''')
The big problem I found is that ADSI...
June 11, 2004 at 9:31 am
Use cast to convert text to int/numeric
OFFERITEMS ON ITEMMAST.EDPNO = CAST(SUBSTRING(OFFERITEMS.OFFERITEM, 9, 8) as int)
June 11, 2004 at 7:02 am
CRLF is not a known variable and activex will create an empty variable.
Try putting
CRLF = chr(13) & chr(10)
at the beginning of your script
June 11, 2004 at 6:40 am
OK, my solution did not distinct the SerialNumbers for Directs. Your solution will give an erroneous Direct count if there are no Directs for a day.
Try this
SELECT SUM(Direct) AS [Direct],
SUM(Total)...
June 10, 2004 at 9:39 am
BOL (Books Online) is as good a place as any. Look up numeric data type, fixed precision and scale.
Precision 18 uses 9 bytes
Precision 9 uses 5 bytes
AFAIK the consumption is...
June 10, 2004 at 8:31 am
What are you looking at to determine the two spaces?
RTrim works with nvarchar, eg
declare @x nvarchar(20)
set @x = 'Daytona '
select cast(@x as varbinary)
select cast(rtrim(@x) as varbinary)
select '"'+rtrim(@x)+'"'
gives
0x44006100790074006F006E00610020002000
0x44006100790074006F006E006100
"Daytona"
June 10, 2004 at 7:51 am
SELECT REPLACE(STR(748,6,0),' ','0')
June 10, 2004 at 7:30 am
Viewing 15 posts - 2,596 through 2,610 (of 3,543 total)