Viewing 15 posts - 18,571 through 18,585 (of 49,552 total)
Your doing it wrong....
Lynn Pettis (5/9/2012)
-- 1st cursor-based solution, loops through all 2135 employee records and updates them all, some with a new salary:
DECLARE empCursor CURSOR FOR
SELECT
...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 11:26 pm
Why are you trying to insert into an identity column?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 3:12 pm
riya_dave (5/9/2012)
is there any way i can use any other things on my table variable,which needs to insert duplicate values.
Temp table, proper indexing, get rid of the cursor, stop guessing.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 2:08 pm
If there are three files in one filegroup, then data will be written to them all according to the proportional fill algorithm
http://msdn.microsoft.com/en-us/library/ms187087%28v=sql.100%29.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 2:04 pm
SQLKnowItAll (5/9/2012)
You can use 1 SP built to handle all 3 of those scenarios and then no views, no functions, and you only change 1 SP. 1 SP per class.
But...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 1:53 pm
cfradenburg (5/9/2012)
Wouldn't it be possible that the code that calls that to be vulnerable to SQL injection though?
Yes, but it's also possible that it isn't. Can't draw any conclusions at...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 1:50 pm
If it's the code with the cursor, it will take ages because there will be hundreds, maybe even thousands of execution plans. If there's a cursor anywhere in the code,...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 1:47 pm
riya_dave (5/9/2012)
i am thinking which join is better ,i am using inner and left join.
Neither. They do different things, so you use the one you need for the data that...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 1:39 pm
Yup, that code is vulnerable to SQL Injection. If it's taking the value straight from user input with no sanitisation, no validation, that's one mighty big hole right there.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 1:36 pm
Putts (5/9/2012)
Because then your App is tied directly to the make-up of each individual SP.
Yes, and what's wrong with that?
1. Create Table
2. Create View
3. Right App...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 1:33 pm
SQLKnowItAll (5/9/2012)
Maybe you missed the post in which Gail said that using a table-valued UDF causes a table scan every time.
I have never said such a thing because it...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 1:27 pm
Whichever account SQL Server is running as.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 1:22 pm
Yes, so was mine when I ran into this. Welcome to UAC. Give it a try, nothing to lose.
If that still doesn't work, check that the folder mentioned exists and...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 12:49 pm
No, that code as you posted can't have any SQL injected. That said, it's very inefficient.
http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/
To have a SQL Injection vulnerability requires that some user input be concatenated into an...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 12:39 pm
Putts (5/9/2012)
Any change to the table then forces you to refresh all your SPs.
Not at all. The only time that a procedure might need refreshing if the table...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 9, 2012 at 12:33 pm
Viewing 15 posts - 18,571 through 18,585 (of 49,552 total)