At the very basic level check the values that the user submits before you send them to the SQL Server and remove any single quotes and semi-colons. You may want to look at this <a href=”http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1318837,00.html”>article </a>as well. SQL injection is usually an issue when dynamic sql is being used in the Stored Procedures. ou [...]
SELECT * FROM <TABLE_NAME> FETCH FIRST 1 ROW ONLY -- FOR MULTIPLE ROWS SELECT * FROM <TABLE_NAME> FETCH FIRST <NUM> ROWS ONLY Please let me know if you need any information -Vijay Kanth Hello, In a relational design, you first have to answer the question “first what?” The previous example will return 1 row, but [...]
Sometimes SQL can be faster and sometimes not. RPG uses the views of the file (logical view or physical if file is keyed). If the view is helpful in getting what you want or need is a relatively small number of steps, it will appear to be fast. If you have a view that does [...]
You can backup SQL Server databases by using the <a href=”http://itknowledgeexchange.techtarget.com/sql-server/back-to-basics-the-backup-database-command/”>BACKUP DATABASE</a> T/SQL command. You can then restore the database using the <a href=”http://itknowledgeexchange.techtarget.com/sql-server/back-to-basics-the-restore-database-command/”>RESTORE DATABASE</a> command.
You can try reapplying the latest service pack (or applying it if you haven’t installed one recently). That should put the newest version of the file into place. If that doesn’t fix it run through the installer and try to repair the install. If that doesn’t fix it uninstall the client tools and reinstall them.
The <a href=”http://msdn.microsoft.com/en-us/library/ms184325.aspx”>ISNULL</a> function could be an option. For example: <pre>Select * From myTable Where ISNULL(Field1,’*')<>’test’</pre> But this option should be avoided as this will not use any indexes that you have setup (If you decide to use it, the replacement value should be a value that you know doesn’t exist in the data in [...]
I don’t think so. Fortunately error handling was improved in 2005. You could query the master.dbo.sysmessages table with the error number, but some specific information (for example, the name of a constraint that was violated) will be missing.
The max number allowed for a bigint column is 9,223,372,036,854,775,807, which you are reaching with the third insert. One option could be changing the datatype of the column, as you suggested. <pre>ALTER TABLE SubscriptionTrans ALTER COLUMN transid NUMERIC(25)</pre> But even the numeric and decimal datatypes have a limit in the amount of digits they can [...]
I don’t think that any stored procedure is called when these errors are run. I believe that the SQL Engine has all the values from the sysmessages stored in cache so that it can access them directly without needing to go back to the sysmessages table.
If you want to track deletions on specific tables, one option could be the use of <a href=”http://msdn.microsoft.com/en-us/library/ms189799.aspx”>triggers</a> and the <a href=”http://msdn.microsoft.com/en-us/library/ms189505.aspx”>xp_sendmail</a> stored procedure. ———————
Thanks for your response. We have a high configuration server for load test. I dont have access to the hardware. I would like to know if there is specific pattern or technique or checklist to attack the database performance issues. What are the possible information should I be looking into to diagonize the database performance [...]
It should give you ’00:00:00′ Lets split it into smaller parts: this is the original expression: <pre>set @BeginTime = DateAdd(mi,-Datepart(mi,@BeginTime)-Datepart(hh,@BeginTime)*60,@BeginTime ) </pre> Now, let’s suppose we make <pre>A = Datepart(mi,@BeginTime)</pre> and <pre>B = Datepart(hh,@BeginTime)</pre> So, our main expression is now: <pre>set @BeginTime = DateAdd(mi,-A-B*60,@BeginTime )</pre> which, is the equivalent to: <pre>set @BeginTime = DateAdd(mi,-A-<b>(</b>B*60<b>)</b>,@BeginTime )</pre> [...]
er I think that analysis services stores dates and then you need to format them in whatever front-end. also you need ot be aware of locale settings on your SSAS server and on the client. Andrew (andrew.fryer@microsoft.com)
I think this is the same question as <a href=”http://itknowledgeexchange.techtarget.com/itanswers/sql-server-2005-query-very-slow-in-the-first-run/”>this one</a>, which was already answered by Kccrosser.
<b>intigreted </b>security’ Try integrated
clicking the “next page” button does a postback to the server. when the server responds with the page, all the logic for connecting the grid to the datasource and showing the grid is in your button click handler. this means you have to click the button to see the grid again (next page). I would [...]
There are two ways to fix this. #1 drop the user on the second server, and recreate it using the same SID as the first server has. #2 After you restore the database use the <a href=”http://itknowledgeexchange.techtarget.com/sql-server/back-to-basics-how-do-i-use-sp_change_users_login/”>sp_change_users_login</a> system stored procedure to match up the logins with the users.
What does it say in the joblog? in QHST? use the query debugging tools What state is thge data in? What access paths exist / are being created? The joblog is your friend
It isn’t the query plan that is getting cached – it is the actual data and indexes which are being cached. This is common behavior of any database. If you ran the query, then waited a while and ran again (keeping the session active), you would see the query take longer again, based on the [...]
<b>Moderator Note:</b> You may leave a comment on the <a href=”http://itknowledgeexchange.techtarget.com/sql-server/”>SQL Server with Mr. Denny</a> blog or send a message to any of our bloggers by emailing our <a href=”mailto:contactus@itknowledgeexchange.com”>ContactUs@ITKnowledgeExchange.com</a> mailbox and we’ll forward to the blogger. Thanks!





