Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

prakash chakrala

@prakash chakrala
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SQL
    P prakash chakrala

    Hi First create Employee table

    CREATE TABLE EMPLOYEE
    (
    Sl_no int identity,
    Name varchar(40),
    Employee_id int

    )

    insert the values

    INSERT INTO EMPLOYEE(Name,Employee_id)
    SELECT 'Anil',1001
    UNION ALL
    SELECT 'Mahesh',1002
    UNION ALL
    SELECT 'Raju',1003

    then create designation table

    CREATE TABLE DESIGNATION
    (
    Employee_id INT,
    Designation varchar(30)
    )

    then insert the values

    INSERT INTO DESIGNATION
    SELECT 1001, 'Developer'
    UNION ALL
    SELECT 1002, 'Tester'
    UNION ALL
    SELECT 1003, 'Trainee'

    then follow this query

    SELECT E.*,D.Designation FROM EMPLOYEE E INNER JOIN DESIGNATION D ON E.Employee_id=D.Employee_id

    Prakash.ch

    Database database help question

  • How to Insert Error_Message() into table and return user defined Message
    P prakash chakrala

    Hi First create table

    CREATE TABLE apl_Error
    (
    Error_Desc VARCHAR(MAX),
    Error_Date DATE
    )

    After that create this procedure

    CREATE PROC SAMPLE
    @ERROR_DESC VARCHAR(MAX) OUTPUT
    AS

    BEGIN
    BEGIN TRY
    CREATE TABLE #TABLE(ID int,fName varchar(20))
    INSERT INTO #TABLE VALUES('A1','CHOICE')
    SELECT @ERROR_DESC=NULL
    END TRY

    BEGIN CATCH
    INSERT INTO apl\_Error(Error\_Desc,Error\_Date)
    SELECT cast( RTRIM(LTRIM(CAST(ERROR\_STATE() as CHAR(10)))) +','+ RTRIM(LTRIM(CAST(ERROR\_LINE() AS CHAR(5))))+','+ERROR\_PROCEDURE()+','+ERROR\_MESSAGE() as varchar(max)),GETDATE()
    
    SELECT @ERROR\_DESC='Error on Inserting'		
    
    
    END CATCH
    

    END

    to execute this procedure

    DECLARE @NAME VARCHAR(MAX)
    EXEC SAMPLE @ERROR_DESC=@NAME OUTPUT
    SELECT @NAME AS Error_Description

    then see apl_Error table now you can see the message and date.

    Error_Desc Error_Date
    1,8,SAMPLE,Conversion failed when converting the varchar value 'A1' to data type int. 2013-07-05

    Database database help tutorial

  • getting common data
    P prakash chakrala

    Hi Arun kumar Could you provide sample data for understanding purpose and from that how you want the data could you give sample output Regards, Prakash.ch

    Prakash.ch

    Database help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups