Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)

  • RE: Insert a record and use new ID value to populate FK field in another table

    A Simple Solution Without Cursor

    Create Procedure InsertUser

    AS

    Begin

    @UserName varchar(25),

    @UserPhone Numeric(18,0),

    @CompanyName Varchar(50),

    Declare @ID As int

    Declare @CId As int

    Set @CId=0

    Set CId =if EXISTS (select CompanyID From Company Where CompanyName Like @CompanyName...

  • RE: Temporary Table

    Here Is Stored procedure

    Assuming only sunday as holiday.

    Create FUNCTION [dbo].[GetWorkingDays]

    ( @StartDate datetime,

    @EndDate datetime )

    RETURNS INT

    AS

    BEGIN

    DECLARE @WorkDays int, @FirstPart int

    ...

  • RE: Find a field name in all the tables of a database

    hi

    here is solution

    SELECT SO.NAME AS "Table Name", SC.NAME AS "Column Name", SM.TEXT AS "Default Value"

    FROM dbo.sysobjects SO INNER JOIN dbo.syscolumns SC ON SO.id = SC.id

    LEFT JOIN dbo.syscomments SM ON...

Viewing 3 posts - 1 through 3 (of 3 total)