Forum Replies Created

Viewing 15 posts - 31 through 45 (of 54 total)

  • RE: define varchardatatype

    bitbucket (12/6/2008)


    You might want to read this article:

    http://support.microsoft.com/kb/154886

    for how varchar values are stored. It also contains very simple sample code so that you can test and view the...

  • RE: if statement after with

    please forgive me,i didnt ask completely:

    i have a table named Gallery

    i wanna select some fields from Gallery base on a specific RowNumber

    i wanna return a value that show whether this...

  • RE: error in select from tempTable

    i need to select a record base on a RowNumber,besides i need to check and return a value that shows whethere this record is or is not the last record...

  • RE: if statement after with

    GilaMonster (11/1/2008)


    Try this.

    DECLARE @state BIT

    SET @state='0'

    ;WITH Im AS (

    SELECT Id,Name,Tag,ROW_NUMBER() OVER(ORDER BY Name DESC)AS 'RowNumber' FROM Galery ...

  • RE: if statement after with

    yes,the error is :

    Incorrect syntax near the keyword 'IF'. :O(

    the Table is this :

    CREATE TABLE [dbo].[Galery](

    [Id] [int] IDENTITY(1,1) NOT NULL,

    [Name] [nchar](50) NOT NULL CONSTRAINT [DF_Galery_Name] DEFAULT (N'~/Images/Gallery/pic.gif'),

    [Tag] [nvarchar](200) NULL,

    ...

  • RE: alert from SQL to my Application

    bitbucket (10/18/2008)

    What language are your apps written in

    Are they web apps

    its a windows service writing with C#

  • RE: alert from SQL to my Application

    i googled and found xp_cmdshell to run my .exe with parameters.

    but when i use this,SQL remain in Executing query batch .. mode!

    whats wrong with this ?

    DECLARE @Parameters CHAR(30)

    SET @Parameters='"calc.exe"'

    EXEC master...

  • RE: select within select

    Matt Miller (10/7/2008)


    dr_csharp (10/7/2008)


    Jason Shadonix (10/7/2008)


    You might also need to give that inner query an Alias?

    SELECT Tab.A,Tab.B FROM (SELECT * FROM Table) Tab

    thanks Jason you are right,but why we do...

  • RE: select within select

    Jason Shadonix (10/7/2008)


    You might also need to give that inner query an Alias?

    SELECT Tab.A,Tab.B FROM (SELECT * FROM Table) Tab

    thanks Jason you are right,but why we do this ?

    i see...

  • RE: do operation on last inserted record by a trigger

    Jeff Moden (10/7/2008)


    dr_csharp (10/7/2008)


    thanks jack . i do this :

    CREATE TRIGGER test ON CallRecorder

    FOR INSERT

    AS

    DECLARE @RecId INT;

    DECLARE @BeginTime NVARCHAR(8);

    SELECT @RecId=RecId,@BeginTime=BeginTime FROM Inserted

    set @BeginTime=substring(@BeginTime,1,3);

    Update CallRecorder

    ...

  • RE: do operation on last inserted record by a trigger

    thanks jack . i do this :

    CREATE TRIGGER test ON CallRecorder

    FOR INSERT

    AS

    DECLARE @RecId INT;

    DECLARE @BeginTime NVARCHAR(8);

    SELECT @RecId=RecId,@BeginTime=BeginTime FROM Inserted

    set @BeginTime=substring(@BeginTime,1,3);

    Update CallRecorder

    ...

  • RE: do operation on last inserted record by a trigger

    Jack Corbett (10/7/2008)


    While this trigger would work it may not be the best way to handle the situation. First you have to define what you mean by last row...

  • RE: get last iserted records

    GilaMonster (10/6/2008)


    @@identity will get you the identity value that you just inserted. MAX(ID) will get you the last value inserted. If multiple users cn be inserting at the same time,...

  • RE: get last iserted records

    GilaMonster (10/6/2008)


    DECLARE @MaxID INT

    SELECT @MaxID = Max(ID) FROM Customer

    which one is better :

    i save @@Identity in a field when record insert in Table and i read saved id in...

  • RE: get last iserted records

    consider this table :

    CREATE TABLE [dbo].[Customer] (

    [Id] [int] IDENTITY (1, 1) NOT NULL ,

    [Code] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

    [Name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

    [Family] [nvarchar] (70)...

Viewing 15 posts - 31 through 45 (of 54 total)