C Sharp and Ms access is best for your project. or choose your db according to length of db.
Ganu Sharma
Posts
-
Need some opinions from experienced desktop application developers -
Check for Null or Empty In SPHi.. 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 =''
-
Select Multi Row, to be Singel RowDear 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.
-
SQL Automatic backupwrite sql server job or sp for automatic backup and schedule it using sql server agent..
-
Entity framework - Fetching values from the middle table in many to many relationshipstry this........... select m.* from roles r, member m, member_roles p where r.mid = p.rid and m.rid = p.rid
-
HOW TO IMPLEMENT MULTIVALUED ATTRIBUTESCreate 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 }
-
SQL QueryYou already have best solution.
-
identity columnidentity 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
-
identity columnidentity 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 :)
-
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.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 ;)
-
basic transaction helpHello. 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 ;)
-
stored procedureStored 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 ;)
-
jointWith 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
-
Alter Queryalter exists column datatype. alter table tblname alter column columnname datatype(variablesize) or add new column................
alter table tblname
add columnname datatype(variablesize) -
How to combine results in cursor?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 nullselect * from @temptable where id is not null ......................... try this......
-
mismatching number of BEGIN and COMMIT statements (T_SQL) [modified]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
-
Check for Null or Empty In SP