Viewing 15 posts - 1,066 through 1,080 (of 1,494 total)
What you are attempting is far from clear. Maybe something like this:
DECLARE @YearStart char(4)
    ,@TermStart varchar(6)
    ,@YearEnd char(4)
    ,@TermEnd varchar(6)
SELECT @YearStart = '2006'
    ,@TermStart = 'Fall'
    ,@YearEnd = '2008'
    ,@TermEnd = 'Fall'
UPDATE academic
SET status = 'N'
WHERE...
October 2, 2008 at 2:55 am
This may help you.
-- *** Test Data **
DECLARE @t TABLE
(
    Col1 int NOT NULL
    ,Image1 varchar(10) NULL
    ,Image2 varchar(10) NULL
    ,Image3 varchar(10) NULL
    ,Image4 varchar(10) NULL
    ,Image5 varchar(10) NULL
    ,Image6 varchar(10) NULL
    ,Image7 varchar(10) NULL
    ,Image8 varchar(10) NULL
    ,Image9 varchar(10)...
October 1, 2008 at 5:51 am
I am not sure what you are trying to do, but the following may help.
SELECT C.Customer_ID, C.[Name], C.Country, R.Region
FROM Countries C
    JOIN
    (
        SELECT 1, 'East' UNION ALL
        SELECT 2, 'West' UNION ALL
        SELECT 3,...
September 30, 2008 at 6:01 am
SET ANSI_NULLS, QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.GetLocationDescription
(
@location_id int
)
RETURNS varchar(8000)
AS
BEGIN
    DECLARE @result varchar(8000)
        ,@Level int
    SELECT @result = ''
        ,@Level = 1
    DECLARE @cte TABLE
    (
        HLevel int NOT NULL
        ,Parent int NOT NULL
        ,[Description] varchar(255) NOT...
September 23, 2008 at 3:05 am
SET ANSI_NULLS, QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.GetLocationDescription
(
    @location_id int
)
RETURNS varchar(8000)
AS
BEGIN
    DECLARE @result varchar(8000)
    SET @result = ''
   WITH cte (HLevel, Parent, [Description])
    AS
    (
        SELECT 1 AS HLevel, T1.Parent, T1.[Description]
        FROM dbo.Location T1
        WHERE T1.location_id = @location_id
        UNION ALL
        SELECT C2.HLevel +...
September 23, 2008 at 2:31 am
This should get you started:
-- *** Test Data ***
CREATE TABLE #t
(
    InvNO int NOT NULL
    ,AccNo int NOT NULL
    ,TR_Age int NOT NULL
    ,Pay_Age int NOT NULL
    ,Amt int NOT NULL
    ,Pay_Amt int NOT NULL
    ,Run_Bal int...
September 11, 2008 at 9:26 am
It depends on the order of the tables. I prefer to think of the * being on the side where all the rows are returned.
--eg
SELECT *
FROM TableA A
    LEFT JOIN TableB...
September 8, 2008 at 5:19 am
The 'N' just means a nchar constant as opposed to a char constant.
September 1, 2008 at 6:21 am
You will need to cast to a float first.
SELECT CAST(CAST(N'2.00701E+16' AS float) AS bigint)
September 1, 2008 at 4:54 am
Your outer joins are effectively being converted to inner joins by the subsequent inner joins.
The joins should be nested so that the FROM clause looks something like:
FROM
    copay...
August 29, 2008 at 3:44 am
DELETE D
FROM
(
    SELECT
        ROW_NUMBER() OVER (PARTITION BY RefNoColumn, RowNoColumn ORDER BY RefNoColumn) AS RowID
    FROM YourTable
) D
WHERE RowID > 1
August 28, 2008 at 10:02 am
I use the following code to do some rough validation when importing email addresses.
SELECT EMail
FROM
(
    SELECT
        EMail
        ,CHARINDEX('.', REVERSE(EMail)) AS DotPos
        ,CHARINDEX('@', REVERSE(EMail)) AS AtPos
        ,CHARINDEX('@', EMail) AS AtPosStart
        ,REVERSE(LEFT(REVERSE(EMail), CHARINDEX('@', REVERSE(EMail)) - 1)) AS DomainName
        ,REVERSE(SUBSTRING(REVERSE(EMail),...
August 28, 2008 at 9:03 am
There is no need for a cursor, try something like:
-- *** Test Data ***
DECLARE @t TABLE
(
    iTableFieldId int NOT NULL
    ,iMenuId int NULL
    ,vFieldsName varchar(100) NULL
    ,iDataTypeName varchar(50) NULL
    ,iFieldLength int NULL
    ,bIsPrimary bit NULL
    ,bIsIdentity bit...
August 28, 2008 at 5:46 am
Rajan John (8/27/2008)
August 27, 2008 at 5:36 am
Viewing 15 posts - 1,066 through 1,080 (of 1,494 total)