Forum Replies Created

Viewing 15 posts - 376 through 390 (of 426 total)

  • RE: Tape backup

    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...

  • RE: Out as Excel File

    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...

  • RE: Excluding Numeric Data

    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),...

  • RE: Compare column data between databases

    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'...

  • RE: Select Statement Errors..??

    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

  • RE: Combining SELECT statements

    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...

  • RE: SQL Newbie - date ?

    WHERE ContractDate = CONVERT(varchar,GETDATE(),112)

    Andy

  • RE: Another Date question

    SET DATEFORMAT MDY

    SELECT city_code, outlet_code, delete_date

    from table1

    WHERE CAST(delete_date AS datetime) > '20070101'

    Andy

  • RE: Inserting date time

    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...

  • RE: MS DTC error when starting the service

    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...

  • RE: A simple One - but the answer escapes me

    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

  • RE: Nested transactions with data environments in VB6

    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...

  • RE: Autonumber Values and Triggers

    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...

  • RE: Using RETURN or SELECT values from EXEC

    Try:

    RETURN (@t)

    Yes I know, stupid syntax that has tripped me up more than once...

    Andy

  • RE: DATETIME TO VARCHAR

    SELECT CONVERT(varchar(10),GETDATE(),112)

    returns:

    20050609

    So CONVERT / Style can do it...

    Andy

Viewing 15 posts - 376 through 390 (of 426 total)