|
Ashutosh Kumar Gupta wrote: what is the difference between Layred Arctitecture and Non Layred Arctitecture?
A layered architecute separates the database from the business logic from the presentation of the information.
A non-layered architecture is sometimes pejoratively called the giant ball of mud architecture. And for good reason, in all but the smallest of projects the code in a non-layered architecture will event resemble a giant ball of mud. Finding anything in that ball of mud becomes increasingly difficult.
|
|
|
|
|
|
create querry to drop a row from table
pradeep kulkarni
|
|
|
|
|
pradeep kulkarni wrote: create querry to drop a row from table
You DROP objects, you DELETE rows.
DELETE FROM MyTable
WHERE primaryKey = 123
|
|
|
|
|
drop table table name;
fuhgldfugyfdkjdluikhusjgh
|
|
|
|
|
|
How can i copy a column from one table to another (data and schema) at runtime in vs 2005?
the data and schema are read from xml files
-- modified at 8:44 Sunday 14th January, 2007
rzvme
|
|
|
|
|
Write an sp, that will do that and call it from your code.
The sp (for SQL server) will look something like this:
INSERT INTO [InsertDB].[dbo].[InsertTable]<br />
( [ColumnName1],[ColumnName2] )<br />
SELECT [ColumnName1],[ColumnName2]<br />
FROM [SourceDB].[dbo].[SourceTable]
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
how to create table in SQL, give one example
pradeep kulkarni
|
|
|
|
|
pra47 wrote: how to create table in SQL, give one example
Look up the SQL syntax for the CREATE TABLE statement in Google or in a reference book. You will need to supply, at a minimum, the field name and field type for each field that you want the table to contain.
HTH
|
|
|
|
|
I have a table Named 'Roles' which contains 'ID' and 'ParentID' fields.
Some Sample Data is
ID ,Name ,ParentID
1 ,Admin ,0
2 ,Manager ,1
3 ,Front Office User ,1
4 ,Supervisor ,2
5 ,Inventory User ,0
6 ,Human Resource User ,4
I would like to extract data of Parent and all children.
SELECT b.[ID] as 'Parent', a.[ID] as 'Role'
FROM Roles a
INNER JOIN Roles b
ON a.ParentID = b.[ID] and a.ParentID=1
which can return only.
ID ,ParentID
1 ,2
1 ,3
My wanted form is
ParentID ,ID
1 ,2
1 ,3
2 ,4
4 ,6
Like an organization tree, the top parent level can access all lower level nodes.
Sql 2005 support that feature.
How can I access them in Sql2000 recursive function or store procedure?
Thanks
May Thu San.
|
|
|
|
|
I think you made a little mistake in your query. This should work:
SELECT b.[ID] as 'Parent', a.[ID] as 'Role'<br />
FROM Roles a<br />
INNER JOIN Roles b<br />
ON a.ParentID = b.[ID]
Wout Louwers
|
|
|
|
|
Sorry, My Query is
SELECT b.[ID] as 'Parent', a.[ID] as 'Role'
FROM Roles a
INNER JOIN Roles b
ON a.[ParentID] = b.[ID] and a.ParentID=1
Some Sample Data is
ID ,Name ,ParentID
1 ,Admin ,0
2 ,Manager ,1
3 ,Front Office User ,1
4 ,Supervisor ,2
5 ,Inventory User ,0
6 ,Human Resource User ,4
The above query can only show the first two child of ID 1 (which are 2,3) and did not show the child of parent 2 and 3...etc.
How can I get all children?
|
|
|
|
|
May Thu san wrote: The above query can only show the first two child of ID 1 (which are 2,3) and did not show the child of parent 2 and 3...etc.
How can I get all children?
by removing the "and a.ParentID=1" from the query.
|
|
|
|
|
I think I understand what you want now. But this cannot be easily solved whit the ParentID. This[^] article should help you.
Wout Louwers
|
|
|
|
|
how to write the query to get the records in between dates
|
|
|
|
|
SELECT * FROM TableName WHERE DateFieldName BETWEEN '1-JAN-07' AND '31-JAN-07'
|
|
|
|
|
how to use sql in host languages like c / c++
|
|
|
|
|
Have you had a look at LINQ?
|
|
|
|
|
how to display all tables from any single database in sql server 7.0.
|
|
|
|
|
select * from Sysdatabases where xtype='u'
|
|
|
|
|
hi,
what are the lock types available with "recordsets" and How different are they from “datasets”
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Please, help me in solving this query
I have a table some thing like this
Sens_Name T2_Value Q_Value CMI_Value
---------------------------------------------------
Sens 1 12 70 80
Sesn 2 13 71 81
I want to query the above table so that I get an output in this way
Sens_Name Stat_Value Stat_Type
--------------------------------------------------------------
Sens 1 12 T2_Value
Sens 1 70 Q_Value
Sens 1 80 CMI_Value
Sens 2 13 T2_Value
Sens 2 71 Q_Value
Sens 2 81 CMI_Value
Thanks in advance
Irsh
|
|
|
|
|
You can use a UNION clause:
SELECT
Sens_Name,
T2_value AS Stat_Value,
'T2_Value' AS Stat_Type
FROM
SensTable
UNION
SELECT
Sens_Name,
Q_value AS Stat_Value,
'Q_Value' AS Stat_Type
FROM
SensTable
UNION
SELECT
Sens_Name,
CMI_Value AS Stat_Value,
'CMI_Value' AS Stat_Type
FROM
SensTable
ORDER BY
Sens_Name,
Stat_Value
|
|
|
|
|