Viewing 15 posts - 751 through 765 (of 1,491 total)
Re-indexing is a bulk logged operation.
If you will never need to restore to a point in time while re-indexing is happening try:
1. Switch to bulk logged.
2. Reindex
3. Switch to Full.
The...
March 14, 2011 at 10:19 am
You could try disabling remote connections first.
March 14, 2011 at 8:01 am
SET ANSI_NULLS, QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE dbo.Insert_Login_Role
@Login_Name nvarchar(50),
@First_Name nvarchar(50),
@Last_name nvarchar(50),
@user_Password nvarchar(50),
--@Login_date date,
@Gender nchar(10),
--@Birth_year date,
@Role_Name nvarchar(50)
-- @Role_ID int
--@Role_ID2 int
AS
SET NOCOUNT ON
INSERT INTO [Login] (Login_Name, First_Name, Last_name, user_Password, Login_date, Gender, Birth_year)
OUTPUT @Role_Name, inserted.Role_ID...
March 11, 2011 at 9:09 am
A NOT EXISTS sub-query will also do as you want:
;WITH CheckTable (Cid)
AS
(
SELECT @param1
UNION ALL SELECT @param2
UNION ALL SELECT @param3
UNION ALL SELECT @param3
)
UPDATE [Table]
SET deleted = 1
WHERE id = @id
AND seq...
March 9, 2011 at 8:50 am
BeginnerBug (3/9/2011)
create table #sample(sno int identity,student_no int, head int,task varchar(50))insert into #sample (student_no,head,task) values(1,10,'tactical')
insert into #sample (student_no,head,task) values(10,20,'basket')
insert into #sample (student_no,head,task) values(20,40,'aerospace')
insert into #sample (student_no,head,task) values(40,10,'robot')
insert into #sample (student_no,head,task) values(10,40,'tackle')
insert...
March 9, 2011 at 6:38 am
An index on Col1, Col2, Col3, Col4, Col5, Col6, Col7 would help.
The following syntax may be more efficient:
;WITH MaxCol
AS
(
SELECT Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8
,MAX(Col7) OVER (PARTITION BY...
March 8, 2011 at 9:21 am
If possible, redesign the schema.
With your current schema, you can UNION ALL queries with SourceType = 1 and SourceType = 2.
March 7, 2011 at 6:06 am
The problem is more complicated if you have multiple levels of foreign keys.
Also the foreign keys may not have the same column names as the referenced column.
The following uses recursion...
March 4, 2011 at 10:17 am
To confirm what has already been said, a relation (table view etc) is an unordered set.
If you are importing data from a text file, and the original order is important,...
February 28, 2011 at 6:56 am
I think it would be best to incorporate the logic of the function into the INSERT statement especially as access to myTable will need to be SERIALIZED.
This could be done...
February 24, 2011 at 9:43 am
Then use a case statement inside the SUM to return 1 or 0 depending a whether the condition is met.
February 23, 2011 at 10:26 am
SELECT SUM(1 & IND1) AS IND1
,SUM(1 & IND1 & IND2) AS IND2
,SUM(1 & IND1 & IND2 & IND3) AS IND3
-- etc
FROM ALL_INDS
February 23, 2011 at 10:11 am
There could be both inserts and updates:
SET ANSI_NULLS, QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[Update2ndTable]
ON [dbo].[Table1]
AFTER INSERT, UPDATE
AS
SET NOCOUNT ON
UPDATE T2
SET EmailAddr = I.EmailAddr
,Folder = RTRIM(UploadPath) + '\' + RTRIM(UserName)+ '\Downloads'
FROM [dbo].[Table2]...
February 23, 2011 at 9:26 am
Without some sample data and DDL it is difficult to say.
You need to do something to ensure that only a one to one relationship exists.
February 21, 2011 at 11:10 am
Viewing 15 posts - 751 through 765 (of 1,491 total)