2,736 Topics

Member Avatar for
Member Avatar for rdz555

consider 5 subjects : A, B, C, D and E. subject A is the father of the subject B. Subject C is the brother of the subject B. subject D is the son of the subject B. subject E is the son of the subject C. Write a stored procedure …

0
39
Member Avatar for sivak

i have one student table stu id sex coloums 1 male 2 female 3 female 4 male 5 female i want retrieve the table male as female and female as male want the result table liek this stu id sex 1 f 2 m 3 m 4 f 5 m …

Member Avatar for mail2saion
0
75
Member Avatar for vedro

Hello I am new to this forum. I am using MS SQL 2005 Express I have a database GK.dbo (the original databese) and I have created a database GK_2009.dbo (it is created from the original database, so it has the same structure) I want to create a script that would …

Member Avatar for vedro
0
128
Member Avatar for sangam100

Hi all, I have a table named comments having columns id, name, email, comment, commentedon, approved, and approvedon. In some cases I would like to let the admin of my asp.net web page to approve all the comments at once. Which would be the effective sql code and why? update …

Member Avatar for kvprajapati
0
95
Member Avatar for sfener06

i need something like a function to do a specific job which work in a specific time.Like every first day of the year i want to sum all the members account amount to my tbl_information table's column. How can i do that?

Member Avatar for kvprajapati
0
62
Member Avatar for Swarv

All, I have an issues form in a database (MS Daily log) and when you fill in the form it save the data into an issues table. Everytime you do this it gives each issue an ID number (auto number). Basically I want to fill in the form then before …

Member Avatar for mrugeshm
0
92
Member Avatar for plut0564

Has anybody used this microsoft tool SSMA? I can connect the two databases OK, and can convert tables from ORACLE to SQLSERVER 2005, but the data refuses to go across. Any info will be helpful. Thanks, Jim

Member Avatar for Ramy Mahrous
0
102
Member Avatar for Rich13

Hi, I'm pretty new to the whole SQL thing, and i'm basically self teaching using manuals, online help and the fact i pick things up quickly. I'm having a bit of trouble picking data up from 2 tables and i think i'm just beign really thick. This is what i'm …

Member Avatar for mail2saion
0
69
Member Avatar for ramanaths

I have the following data in a table named dtlstbl which has columns id and refid 100,1 100,2 101,1 102,2 103,1 103,2 I am fetching data from this table thus select id from dtlstbl where refid in (1,2) All the records are returned. I want a SQL 2000 query that …

Member Avatar for mail2saion
0
73
Member Avatar for manojjena1982

Hi! all Let me explain the problem:- I have two tables A(aid,aname,adesc),B(bid,aid,bdesc). I want a query which will extract all records of 'aid' in 'B'. means aid bid aname bdesc 1 1 qw eeg 2 null re null 3 4 sd v tyuy 4 null dffg null Hope to get …

Member Avatar for mail2saion
0
76
Member Avatar for chedderslam

I have a couple of queries in a union all that need to get all records, some from the first where clause, and everything else in the other. Here is the original where clause: [code=sql]from license_status ls, pos_driver pd, pos_policy pp where pp.pos_id = @pos_id and pd.pos_id = pp.pos_id and …

Member Avatar for mail2saion
0
91
Member Avatar for ssreevidya.m

Hi, How can I delete duplicate records from a table in a single query. Thanks in advance.

Member Avatar for Aslam Patel
0
99
Member Avatar for MeRocKs

i'm using sql server 2005 for my asp.net program. i have 2 tables, first table X, second table Y X has column: [code]DEM_ID int DEM_DATE datetime DEM_QTY numeric(18,0) constraint PK_DEMAND primary key nonclustered (DEM_ID)[/code] Y has column: [code]FRC_ID int FRC_YEAR numeric(4) FRC_MON numeric(2) FRC_SALES numeric(18,0) FRC_FRCSALES numeric(18,0) FRC_FRCLOG numeric(18,0) constraint …

Member Avatar for mail2saion
0
225
Member Avatar for tadisaus2

I have a dynamic query: ID Name Num ------------ 22 A 2 22 B 3 23 C 1 23 D 2 23 E 2 How to create a dynamic query to calculate the total like below? ID Name Num Total ----------------- 22 A 2 7 <=> (2*2)+3 22 B 3 …

Member Avatar for mail2saion
0
69
Member Avatar for luxmraj

How to re-write this self-join queries by using the sub-query Structure (without using the CONNECT BY clause)? [code=sql]SELECT f1.child as parent, f2.child FROM FamilyTree f1, FamilyTree f2 WHERE f1.child = f2.parent[/code] [code=sql]SELECT f1.child as grandparent, f3.child as grandchild FROM FamilyTree f1, FamilyTree f2, FamilyTree f3 WHERE f1.child = f2.parent AND …

0
43
Member Avatar for rohithmishra

Hi, Can anyone tell me how can we know if any updation is done in table such as insertion | Deletion | Modification of record in one or more table without peeping inside the table... say, finding the history records that are updated... To be more clear; say I have …

Member Avatar for Ramy Mahrous
0
133
Member Avatar for lia_IT

Hello i have some issues in how to display data in specific format (i am using SQL server 2008 & visual web developer 2008 C#) - how to display the data input as percentage like this 3% - i have field which the input should be more than zero (how …

Member Avatar for Ramy Mahrous
0
119
Member Avatar for Kusno

Dear all, How do I change primary key field from query because if I use VS Designer, raised an error about [B]time expired[/B] ? I want to extend my FK field length. Thanks

Member Avatar for Kusno
0
128
Member Avatar for blozzy

hi, i would like to make an insert statement with a subquery, i know that it is possible with a following select command, but i would like to combine it with scalar vars from a data grid ? please help: [code] INSERT INTO akquise_dispo_stunden(sb_id,akquiseprojekt_id,monat,jahr,ma_name,stunden)VALUES(@sb_id,'test',1,@jahr,([B]SELECT name FROM ma WHERE user_id=@sb_id[/B]),@JanStd); [/code] …

Member Avatar for sknake
0
129
Member Avatar for vuyiswamb

Good Morning All I have a table named “Final” with Values like this [code] ID || DESCR || CYCLE ====================================== 1 || Earl G || 20 2 || Earl G || 21 3 || Earl G || 22 4 || Davidson I Dr || 20 5 || Davidson I Dr …

Member Avatar for vuyiswamb
0
465
Member Avatar for sivak

when we for trigger in c# .net ..can anyone expalin me with simple example

Member Avatar for Ramy Mahrous
0
91
Member Avatar for gillivt

I am using SQL Server 2005 express. I want to insert a record into a table and return its primary key. Here is my SQL Procedure: [code=sql] ALTER PROCEDURE InitialiseHistory AS INSERT INTO StatusHistory (StatusCode, DateChanged, Comments) VALUES (0, { fn NOW() }, 'Status initialised to UNKNOWN') RETURN SCOPE_IDENTITY() [/code] …

Member Avatar for gillivt
0
196
Member Avatar for westdh

Having problems building a select list with an aggregate and Group by Clause Using VWD and mssql server express 2008 Below I have listed two conditions one that works and one that does not. I have named them example 1 and 2 Example 1: A working Select List ----------------------------------------------------------------------------------------------------- Example …

0
63
Member Avatar for rastinrastini

In The Name Of God Hello All i will connect to my table in sql server 2008 but display this message to me. [url]http://www.uploadgeek.com/share-10D4_49F1AEF5.html[/url]. can anyone tell me how can solve this prfoblem? thanks alot. goodbye.

Member Avatar for rastinrastini
0
242
Member Avatar for help108

I have simple question. How to list Max people with tie. select student.stdname from student, class where (select max(class.awrd) from class) = class.stdnumb and class.stdnumb = student.stdnumb; Apparently, student table have tie for student total awards they received. If I run above query it will list only one Max awarded …

Member Avatar for mail2saion
0
60
Member Avatar for brixton

Hello! I have a DB setup which simplified looks like this: PRODUCT(id, owner_id) OWNER(id) What I want to do is to produce a list of how many products each owner has, and then sort it in some way, all in a single query. How do I go about this? Thanks!

Member Avatar for brixton
0
106
Member Avatar for vampke

Hi guys, I'm stuck at this query I'm writing. I'm hoping someone will be able to help me. I have 2 linked tables: subjects and visits with a relationship on subject_id: table subjects: Subject_id, name, birthdate table visits: Visit_id, Subject_id, parameter1, parameter2 Now I need to query that will get …

Member Avatar for vampke
0
102
Member Avatar for freshfitz

Can I reformat a phone number in SQL manager. I imported a foxpro dbf with the dts wizard and it imported the phone number as (609) 555-1212 I need it to be 6095551212

Member Avatar for freshfitz
0
97
Member Avatar for stuwer12

Hi, I have a problem with an insert into ms sql(web-based). I keep getting an error Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ';'. /admin/dataentry2.asp, line 147 the actual code the asp page is [code]function addRecord() v_Name = replace(Request.Form("Name"), "'", "'") …

Member Avatar for stuwer12
0
172
Member Avatar for lovely_girl1989

[url]http://www.picturebang.com/images/331323386942[/url] Hi to all, this the first post in the forum and i have some of questions need to be made in SQL Statements.. i tried to answer some of them and the other i don't how to make it.. so plz help me becauze i'm a new in SQL …

Member Avatar for Ramy Mahrous
0
141

The End.