Viewing 15 posts - 46 through 60 (of 82 total)
sys.dm_db_index_physical_stats can be used in all DB
just right click on YourDatabase then select New Query
in that query window run query which i have posted.
Just write DBname with USE you...
November 1, 2012 at 2:56 am
Try this one
select a.*,b.AverageFragmentation from
(
SELECT
tbl.name AS [Table_Name],
tbl.object_id,
i.name AS [Name],
i.index_id,
CAST(CASE i.index_id WHEN 1 THEN 1 ELSE 0 END AS bit) AS [IsClustered],
CAST(case when i.type=3 then 1 else 0 end AS...
November 1, 2012 at 12:21 am
Yes it will.
with respect to performance it may different. but result will be same
October 31, 2012 at 11:35 pm
Try this one
declare @emp table(EMPNo varchar(10),fullnam varchar(20))
declare @tfile table(EMPNo varchar(10),CDate datetime,Ctime datetime)
insert into @emp
select * from
(
Values
('0001','xyz1'),
('0002','xyz2'),
('0003','xyz3'),
('0004','xyz4'),
('0005','xyz5')
)a (no,name)
insert into @tfile
select * from
(
Values
('0001','10/29/2012','2012-10-29 07:52:00.000'),
('0001','10/29/2012','2012-10-29 19:00:00.000'),
('0002','10/29/2012','2012-10-29 07:40:00.000'),
('0002','10/29/2012','2012-10-29 19:32:00.000'),
('0005','10/29/2012','2012-10-29 07:58:00.000'),
('0005','10/29/2012','2012-10-29...
October 29, 2012 at 11:25 pm
To create Dynamic variable table
declare @temptable table
(
id int identity(1,1),
name varchar(50)
)
insert into @temptable
select name from yourtable
October 29, 2012 at 10:56 pm
even for avg Data Size
sp_spaceused TableName
Output
name rowsreserveddataindex_sizeunused
TableName11 32 KB8...
October 29, 2012 at 7:17 am
If you using merge solution given by "Jason-299789 " then duplicate data will not going to come
and if you want to delete duplicate record from same table
then use simple row_number,or...
October 29, 2012 at 4:58 am
how about trigger on primary or on Child table base on your requirment.
why you want to use foreign key?
foreign key is for the relation and CONSTRAINT on table
October 29, 2012 at 4:39 am
why cant go for simple replace
declare @test-2 varchar(100)='<test@gmail.com>;<test1@gmail.com>'
select REPLACE(replace(@test,'>',''),'<','')
it does matter how many email in columns.
what say?
October 29, 2012 at 1:35 am
insert into A( id_a,b,c,id_m) values (1,2,3,(select id_m from B where id_m=5))
This will work unless and until
select id_m from B where id_m=5 return only one(return multiple value not allowed gives error)...
October 29, 2012 at 1:27 am
I havent try that Sqllite db
but if toy create table like
CREATE TABLE test (ID INTEGER PRIMARY KEY AUTOINCREMENT,Othercol varchar(20))
then try to remove AUTOINCREMENT from that and create table
October 29, 2012 at 1:13 am
yes then go for Inner join and yes do Normalize you table ,
Like companymaster,workregmaster,empmaster,addressmaster,workdetail
just take care that data should not repeat in table ,it will affect size and performance.
you will...
October 29, 2012 at 12:55 am
yes create one more table
1)WRegn Master where WRegnNum is PK having(WRegnNum PK,Wregname,Address_id,NumOfEmployees)
2)Workplace (Workplacecode PK,WRegnNum,Empid)
3)EmployeeMaster
4)AddressMaster
so Data will not repeat and save your size and everything
now as far as...
October 29, 2012 at 12:37 am
Is it what you want or just give me result which you want base on this data
so that can give you query
declare @workplace table(
Workplacecode int...
October 28, 2012 at 11:59 pm
Okk now
for 2nd Employee it would be
Workplace code-2
WRegNum-098-098 (Company reg Number) (It will be same )
WorkplaceName- Oracle Inc
NumOfEmplouees-1000
EmpName - 'Bill' (I get emp name from Employee table using EmpNumber...
October 28, 2012 at 11:50 pm
Viewing 15 posts - 46 through 60 (of 82 total)