2,736 Topics
| |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
Hi, How can I delete duplicate records from a table in a single query. Thanks in advance. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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] … | |
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 … | |
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] … | |
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 … | |
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. | |
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 … | |
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! | |
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 … | |
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 | |
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"), "'", "'") … | |
[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 … |
The End.