Forum Replies Created

Viewing 15 posts - 361 through 375 (of 444 total)

  • RE: how to update a rows of data using a function in a Stored Procedure

    As far as I underrstood ur problem, you are already doing the job.

    I dont know why are you going for TOP 1/

    Just run the two queries as;

    -- To...

  • RE: Calculating Age

    My Way to calculate...

    DECLARE @dd AS DATETIME

    SELECT @dd = Dateadd(YEAR,-10, getdate())

    SELECT @dd

    Select DATEDIFF(yy, @dd, GETDATE()) - CASE

    WHEN DATEPART(m, @dd) > DATEPART(m, GETDATE())

    THEN 1

    When DATEPART(m, @dd) =...

  • RE: IdentityColumn is Duplicated ?

    The data in the Identity Column can be duplicated if it is Not a PK or the column is Not Uniquely Indexed. This can be checked by using

    SET IDENTITY_INSERT...

  • RE: collation

    R u having problem in data sort?

    I think the default Collation is

    SQL_Latin1_General_CP1_CI_AS

    try query to check for your options...

    SELECT Name, Description FROM fn_helpcollations()

    WHERE name like 'L%'

    SELECT Name, Description FROM...

  • RE: Hide records with duplicate value in column

    Here You Go...

    CREATE TABLE [dbo].[Tab2](

    [c3] [int] NOT NULL,

    [c4] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL

    ) ON [PRIMARY]

    Go

    INSERT INTO Tab2

    SELECT 1,'A' UNION ALL

    SELECT 2,'B' UNION ALL

    SELECT 2,'C' UNION ALL

    SELECT 2,'A' UNION ALL

    SELECT 3,'A' UNION...

  • RE: Recommended reading?

    Professional SQL Server 2005 Programming By Robert Vieira

    Inside Microsoft SQL Server 2005: T-SQL Programming

    byItzik Ben-Gan, Dejan SarkaandRoger Wolter

    Microsoft Press 2006 (532 pages)

    BOL, MSDN, and Alot more...

    Atif Sheikh

  • RE: Auto Indentation

    I was looking for the reply of this post...

    Nice tool found.

    Thanks Markus Bohse

    Atif Sheikh

  • RE: Cursors and variables outside them

    Ofcourse I know that the return value can be set in the SP and it returned accordingly IF it is retunned using RETURN.

    SP also returns a vlaue and that...

  • RE: Cursors and variables outside them

    Dear Mrbaseball34...

    Comming to your SP code for rr_Insert_ptEncounterDetail

    CREATE PROCEDURE rr_Insert_ptEncounterDetail

    @ptEncounterDetailID int

    AS

    BEGIN

    INSERT INTO ptEncounter (EncounterDetailID) VALUES (@ptEncounterDetailID)

    SELECT SCOPE_IDENTITY()

    GO

    If you are running the same code...

  • RE: Cursors and variables outside them

    Sorry for the confusion due to my incomplete statement. Sp returns the return value when you Exclusively specify it. Otherwise it ALWAYS returns zero if executed successfully and retuirns an...

  • RE: Reusing a temp table for stored procedures

    If the structure of the temp table remains the same for all the reports, and only the data is changed according to the criteria, then the INDEXED VIEW will be...

  • RE: to create exe for sql

    But the best is that you should create a script file, as suggested above for the tables that you want on the new machine.

    Atif Sheikh

  • RE: to create exe for sql

    As far as I understood your question, you are trying to create some tables through your VB application at runtime. For example on Clicking the commandbutton1, Table1 created on the...

  • RE: Insert into Statement problem??

    CREATE TABLE Test(Col int DEFAULT 0)

    INSERT INTO test

    SELECT TOP 10 0 AS N

    FROM Master.dbo.SysColumns

    You can change number of records in TOP and Default value as you like and...

Viewing 15 posts - 361 through 375 (of 444 total)