Viewing 15 posts - 376 through 390 (of 426 total)
Use the VERITAS web site or Help for drive trouble shooting, I have had to use their tape utility to remove and add the DLT tape device 3 times in...
June 16, 2005 at 1:14 am
Check out script: http://www.sqlservercentral.com/scripts/contributions/763.asp
Change the SQL to what ever you want.
The tricks are: to EXEC dynamic SQL, because at parse time the Excel "table" does not exist; CREATE tableName...
June 16, 2005 at 12:40 am
If you need Alpha or Numeric from a mixed string:
CREATE FUNCTION fn_ConvAlpha
(
@String varchar(8000)
)
RETURNS varchar(8000)
AS
BEGIN
-- Strip non-Alpha characters
DECLARE @Cnt int, @Lgth int, @Temp varchar(8000), @C char(1)
SELECT @Temp='', @Lgth=LEN(@String),...
June 16, 2005 at 12:30 am
IF NOT EXISTS(SELECT srvname from master.dbo.sysservers where srvname = 'ServerName')
BEGIN
EXEC sp_addlinkedserver 'ServerName', N'SQL Server'
EXEC sp_addlinkedsrvlogin 'ServerName'
END
-- Show DEV not in PROD
SELECT DEV.IdentityField AS 'Dev IdentityField'
, PROD.IdentityField AS 'Prod IdentityField'...
June 16, 2005 at 12:18 am
Cuz IN is out?
Not the 1st IN strangeness that I have seen, once deleted all rows in a table when the IN clause returned a NULL value! TGIH for backups...
Andy
June 15, 2005 at 11:59 pm
Given your original queries:
SELECT SQ.*
, ST.SLlastName AS SendTo
, BT.SLlastName AS BillTo
, R.SLlastName AS Requestor
, DE.*
FROM schoolrequest SQ
INNER JOIN academicoffice ST ON SQ.SLsendToId=ST.AOid
INNER JOIN academicoffice BT ON SQ.SLbillToId=BT.AOid
INNER JOIN academicoffice R...
June 15, 2005 at 11:51 pm
WHERE ContractDate = CONVERT(varchar,GETDATE(),112)
Andy
June 15, 2005 at 10:33 pm
SET DATEFORMAT MDY
SELECT city_code, outlet_code, delete_date
from table1
WHERE CAST(delete_date AS datetime) > '20070101'
Andy
June 15, 2005 at 10:23 pm
SELECT CONVERT(varchar(8), lauthdate, 112)
No need to convert to datetime T-SQL will do that for you.
Using ISO date format works with DATEFORMAT = MDY, YMD, or DMY
SET DATEFORMAT mdy
GO
DECLARE @datevar...
June 15, 2005 at 1:44 am
From Event ID web site:
http://www.eventid.net/display.asp?eventid=4404&source=MSDTC
Ionut Marin (Last update 7/21/2004):
From a newsgroup post: "I was able to fix the problem and the solution is very simple. Here is the...
June 13, 2005 at 11:37 pm
Try:
SET QUOTED_IDENTIFIER OFF
DECLARE @Name varchar (20)
SET @Name = "Bob's bad name"
SELECT "Bob's bad name", @Name
SET QUOTED_IDENTIFIER ON
Andy
June 10, 2005 at 5:09 am
SQL Server does not support nested transactions as you might think, example:
BEGIN TRANS T1 WITH MARK 'My Bad Transaction'
-- data changes
BEGIN TRANS T2
-- data changes
IF 1=1
ROLLBACK TRANS...
June 10, 2005 at 4:40 am
I believe structure of the CREATE TABLE #Temp does not match the query, why not:
IF (SELECT OBJECT_ID('tempdb..#Test')) > 0
EXEC ('Drop TABLE tempdb..#Test')
SELECT A.Ctr,A.AcademicYear_Code,A.AcademicYear_Code-1,A.Student_No
,A.Student_RollNo,A.Student_Name,B.Student_GrNo,A.Student_Std
,A.Student_Division,A.Subject_Code,A.Subject_Name
,A.MTMarksObtained,A.MTGradeObtained,A.MTSubjectRank
,A.MTTotalMarksObtained,A.MTTotalMarksOutOf,A.MTRank,A.MTDivision
,A.TTMarksObtained,A.TTGradeObtained,A.TTSubjectRank
,A.TTTotalMarksObtained,A.TTTotalMarksOutOf,A.TTRank,A.TTDivision
,A.FTMarksObtained,A.FTGradeObtained,A.FTSubjectRank
,A.FTTotalMarksObtained,A.FTTotalMarksOutOf,A.FTRank,A.FTDivision
,A.Attitud_Student
INTO #Test
FROM trn_Progress_Card_Data A
LEFT OUTER JOIN Mst_Student...
June 10, 2005 at 12:42 am
Try:
RETURN (@t)
Yes I know, stupid syntax that has tripped me up more than once...
Andy
June 9, 2005 at 8:15 pm
SELECT CONVERT(varchar(10),GETDATE(),112)
returns:
20050609
So CONVERT / Style can do it...
Andy
June 9, 2005 at 8:06 pm
Viewing 15 posts - 376 through 390 (of 426 total)