Viewing 15 posts - 16 through 30 (of 51 total)
As all others said, if you monitor it and all is good - no worries.
I would keep the data and log files separate as the log file is accessed sequentially...
January 27, 2011 at 1:40 am
BOL says to not use sp_attach_db - it has been deprecated.
That said, sp_attach_db and CREATE database... (replacement for sp_attach_db) is not being trapped when using a catch block.
So no closer...
January 26, 2011 at 7:24 am
You are most welcome. I love it when a plan comes together!
January 21, 2011 at 4:07 am
If you want to filter for the current logged in user, try a where clause
WHERE A.[USERNAME] = SUSER_NAME()
You might want to look into the following functions to get the current...
January 20, 2011 at 6:21 am
I cannot make sense of what you are trying to say.
Please show the expected result for the data you have created.
January 20, 2011 at 5:24 am
Something like this?
select
A.[USERID]
,A.[USERNAME]
,B.[INVOICENO]
,B.[INVOICEAMT]
from
Table_A a
left join Table_B b on a.USERID = CASE WHEN A.ISADMIN = 1 THEN A.USERID ELSE B.USERID END
January 20, 2011 at 5:04 am
This seems more of a programming query.
If you use .net, see http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executenonquery.aspx
for why it will return -1.
January 20, 2011 at 2:42 am
A few observations:
I see a call to what I presume is a scalar function on the insert: fnMD5ExLo. Maybe it would be better to do that outside the merge -...
January 20, 2011 at 2:39 am
The where clause with the or 1=1 would always evaluate to true.
Change the procedure to:
alter Procedure test (@id int,@status varchar(50),@stdt datetime,@eddt datetime)
As
Begin
Select * from...
January 20, 2011 at 2:22 am
CELKO (1/17/2011)
Each module of code should have one entry and one exit point. Each module of code should perform one and only one task....
January 18, 2011 at 3:57 am
I prefer a seperate SP for the delete operation. At work we have seperate SP's for Insert/update but my personal preference is just one for the insert/update.
My experience is...
January 17, 2011 at 6:49 am
You needed begin and end around your if statement, otherwise it only evaluates one statement as part of the if.
Declare @Month int,
@Year int
Set @Month = DatePart(mm,Getdate()) -1
if @Month = 0
begin
set...
January 14, 2011 at 9:55 am
I think Nevyn is on the right track. I would just be careful as SQL server cannot use the parameters calculated inside a stored proc to calculate a good plan,...
January 14, 2011 at 9:45 am
Instead of using @@Identity, use SCOPE_IDENTITY().
Also, we have also found that openxml was faster that XQuery. If we queried more than 3 nodes on the xml then we found openxml...
January 14, 2011 at 9:40 am
Just switch the statement to create the default with the alter column statement.
ALTER TABLE [employee]
ALTER COLUMN [salary] [int] NOT NULL
ALTER TABLE [employee]
ADD DEFAULT -2 FOR [salary]
If you want to have...
January 14, 2011 at 2:14 am
Viewing 15 posts - 16 through 30 (of 51 total)