SQL Injection Validation
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 [...]

View Answer   |  July 29, 2009  6:48 PM
SQL injection, SQL Injection Validation, SQL Server Data Validation
answered by:
15 pts.

How to select 1 record in DB2
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 [...]

View Answer   |  April 18, 2013  2:24 PM
DB2, SELECT statement
answered by:
5,205 pts.

SQL vs RPG
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 [...]

View Answer   |  July 28, 2009  7:20 PM
SQL vs RPG
answered by:
110 pts.

sql server 2000 how can i make backup 4 file only and restore
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.

View Answer   |  July 28, 2009  6:52 AM
SQL Server 2000, SQL Server backup, SQL Server backup and restore
answered by:
64,520 pts.

SQL Server Errors
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.

View Answer   |  July 27, 2009  5:31 AM
SQL Server error messages
answered by:
64,520 pts.

Eliminating Nulls in tSQL
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 [...]

View Answer   |  July 24, 2009  8:13 PM
ANSI, NULL, T/SQL
answered by:
1,610 pts.

TSQL error messages
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.

View Answer   |  July 24, 2009  6:29 PM
SQL Server 2000 error message
answered by:
63,535 pts.

Identity Reseed SQL Server 2005
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 [...]

View Answer   |  July 24, 2009  3:19 PM
SQL Server 2005, SQL Server 2005 (32-bit)
answered by:
63,535 pts.

Formating Sysmessage text
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.

View Answer   |  July 23, 2009  10:47 PM
SQL Server 2000
answered by:
64,520 pts.

Being notified when a delete operation is performed on SQL Server
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. ———————

View Answer   |  July 23, 2009  7:30 PM
SQL Server security
answered by:
63,535 pts.

Web Application very slow SQL 2005
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 [...]

View Answer   |  July 23, 2009  4:58 PM
SQL 2005, sql 2005 Performance Issues
answered by:
3,830 pts.

order of evaluation in DateAdd with multiple expressions
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> [...]

View Answer   |  July 21, 2009  7:49 PM
SQL Server DateTime, SQL Server Functions
answered by:
63,535 pts.

Changing date fields in SQL Server Analysis Services
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)

View Answer   |  July 21, 2009  6:52 PM
SQL Server Analysis Services, SSAS
answered by:
15 pts.

Improving the initial speed of a SQL query
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.

View Answer   |  July 21, 2009  6:21 PM
SQL queries, SQL Query, SQL query optimization
answered by:
63,535 pts.

Error connecting to a SQL database
<b>intigreted </b>security’ Try integrated

View Answer   |  July 21, 2009  4:14 PM
Connection Issues, SQL Database, SQL Database Connection Issues
answered by:
50 pts.

Why isn’t my data displaying in the next page of Gridview?
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 [...]

View Answer   |  July 21, 2009  12:14 AM
ASPX, GridView, SQL data source, VBScript, Visual Studio, Visual Studio 2005
answered by:
15 pts.

SQL Server Security Login does not work after restoring database on another computer
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.

View Answer   |  July 20, 2009  9:43 PM
SQL Server, SQL Server security, SQL Server Security Login
answered by:
64,520 pts.

Sql Query in AS400
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

View Answer   |  July 20, 2009  3:35 PM
SQL Query, SQL query optimization
answered by:
5,505 pts.

SQL Server 2005 Query Very Slow in the first run
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 [...]

View Answer   |  July 17, 2009  4:59 PM
SQL queries, SQL query optimization, SQL Server 2005
answered by:
3,830 pts.

thanks
<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!

View Answer   |  July 17, 2009  12:45 PM
ITKE, SQL Server
answered by:
6,565 pts.