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
G

Ganu Sharma

@Ganu Sharma
About
Posts
17
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Need some opinions from experienced desktop application developers
    G Ganu Sharma

    C Sharp and Ms access is best for your project. or choose your db according to length of db.

    Database database csharp sql-server sysadmin question

  • Check for Null or Empty In SP
    G Ganu Sharma

    Hi.. check your parameter is null or not. in stored procedure if(parameter is null or parameter ='') begin sql statements end else begin sql statements end or in single query. select * from tbl where parameter is null or parameter =''

    Database sharepoint database help question

  • Select Multi Row, to be Singel Row
    G Ganu Sharma

    Dear You can use group by clause. select c1, c2, isnull(sum(c3),0), isnull(sum(c4),0) from tbl group by c1, c2 use having clause for again filter your output. use it after grope by clause.

    Database question

  • SQL Automatic backup
    G Ganu Sharma

    write sql server job or sp for automatic backup and schedule it using sql server agent..

    Database database sql-server sysadmin tutorial

  • Entity framework - Fetching values from the middle table in many to many relationships
    G Ganu Sharma

    try this........... select m.* from roles r, member m, member_roles p where r.mid = p.rid and m.rid = p.rid

    Database help

  • HOW TO IMPLEMENT MULTIVALUED ATTRIBUTES
    G Ganu Sharma

    Create two tables as: Item_Category {ItemID int identity(1,1) primary key, Item_CategoryName NVARCHAR(100)) AND another one is Item { ItemSrNo int identity(1,1) primary key, ItemID int, --foreign key references values from Item_Catory Table Column3, ,,,n }

    Database tutorial question

  • SQL Query
    G Ganu Sharma

    You already have best solution.

    Database database help tutorial question

  • identity column
    G Ganu Sharma

    identity automatically increment your column values from seed property specified in identify clause.

    exam
    create table tbl
    ( i int
    identity(1000,1), name varchar(100))

    output 1000 ;P 1001 1002

    Ganu Sharma

    Database database question

  • identity column
    G Ganu Sharma

    identity automatically increment your column values from seed property specified in identify clause. exam create table tbl ( i int identity(1000,1), name varchar(100)) output as 1000 table1 1001 table2 1002 table3

    Ganu Sharma :)

    Database database question

  • Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
    G Ganu Sharma

    try this query.......... select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code from D4A_RAW_BLP where vessel_code is not null) order by vessel_code

    Regards: Ganu Sharma ;)

    Database help database

  • basic transaction help
    G Ganu Sharma

    Hello. your problem is rollback your transaction to previous state if any error occur in transaction. you can use @@error cursor variable to recognize error. examlple begin transaction transaction1 update statment if(@@rowcount > 0) commit transaction transaction1 else if(@@error > 0) begin SET @errcode = error_message() insert into errorlog select @errcode rollback transaction transaction1 end

    Regards: Ganu Sharma ;)

    MySQL help database mysql sql-server security

  • stored procedure
    G Ganu Sharma

    Stored procedure are pre-compiled object of db. they are consist of block of sql statments & procedural statements. you can call them on your db server. They accept in, out, inout parameter. Sp modify the value of out parameter and you can send them your calling enviourment as output or similar to function returned value. but you cannot use return statement in sp. sp never return value like function. means you can only use sp output parameters for returning more values. ................. eg. Create procedure YourSpNAME @para1 int, @para2 varchar(100) output AS BEGIN select @para1 set @para2 = 'output' END @declare @output varchar(100) execute YourSpNAME 1045, @output output print @output

    Regards: Ganu Sharma Sql Developer ;)

    MySQL database tutorial

  • joint
    G Ganu Sharma

    With Oracle, we are used to joining datasets by combinations of datasources in the FROM clause and a WHERE clause to join them together. Datasets are usually tables, but can also be views, in-inline views, subqueries, table functions, nested tables and so on. Oracle join syntax is generally as follows: SELECT ... FROM dataset_one d1 , dataset_two d2 WHERE d1.column(s) = d2.column(s) AND ... With this syntax we separate datasources by commas and code a single WHERE clause that will include the join predicates together with any filter predicates we might require. ANSI join syntax is slightly different on two counts. First, we specify the type of join we require and second we separate the join predicates from the filter predicates. ASNI syntax can notionally be expressed as follows: SELECT ... FROM dataset_one d1 JOIN TYPE dataset_two d2 ON (d1.column(s) = d2.column(s)) --<-- can also use USING (column(s)) WHERE filter_predicates... As commented, the ON clause is where we specify our joins. If the column names are the same, we can replace this with a USING clause. We will see examples of both methods for expressing join predicates throughout this article. Given this pseudo-syntax, we will examples of the following join types in this article. * INNER JOIN * NATURAL JOIN * CROSS JOIN * LEFT OUTER JOIN * RIGHT OUTER JOIN * FULL OUTER JOIN inner join When we join two tables or datasets together on an equality (i.e. column or set of columns) we are performing an inner join. The ANSI method for joining EMP and DEPT is as follows. SQL> SELECT d.dname, d.loc, e.ename, e.job 2 FROM dept d 3 INNER JOIN 4 emp e 5 USING (deptno); DNAME LOC ENAME JOB -------------- ------------- ---------- --------- RESEARCH DALLAS SMITH CLERK SALES CHICAGO ALLEN SALESMAN SALES CHICAGO WARD SALESMAN RESEARCH DALLAS JONES MANAGER SALES CHICAGO MARTIN SALESMAN SALES CHICAGO BLAKE MANAGER ACCOUNTING NEW YORK CLARK MANAGER RESEARCH DALLAS SCOTT ANALYST ACCOUNTING NEW YORK KING PRESIDENT SALES CHICAGO TURNER SALESMAN RESEARCH DALLAS ADAMS CLERK SALES CHICAGO JAMES CLERK RESEARCH DALLAS FORD ANALYST ACCOUNTING NEW YORK MILLER CLERK

    Database

  • Alter Query
    G Ganu Sharma

    alter exists column datatype. alter table tblname alter column columnname datatype(variablesize) or add new column................

    alter table tblname
    add columnname datatype(variablesize)

    Database database tutorial question

  • How to combine results in cursor?
    G Ganu Sharma

    Dear you try....... you can reduce your null selection by is null clause. you can use union or union all are two method combine multiple results set. select 101 union select null union select 102 union select null union all result will be as... null, null 101 102 101 102 create table temp table insert into @temptable(ID)

    select 101
    union
    select null
    union
    select 102
    union
    select null

    select * from @temptable where id is not null ......................... try this......

    Database database tutorial question

  • mismatching number of BEGIN and COMMIT statements (T_SQL) [modified]
    G Ganu Sharma

    try something like this. start your transaction begin transaction a insert into tableA if(@@rowcount > 0) begin insert into tableB commit transaction a end else (@@error > 0) begin rollback transaction a end

    Database regex help

  • Check for Null or Empty In SP
    G Ganu Sharma

    You can check your parameter is null or empty. there are various way in sql server or oracle database. declare @IP NVARCHAR(SIZE) IF(@IP IS NULL OR @IP = '') BEGIN SQL STATEMENTS. END ELSE BEGIN SQL STATEMENTS. END IF(@@ERROR > 0) SQL STATEMENTS. :) :)

    Database sharepoint database help question
  • Login

  • Don't have an account? Register

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