I have a java app + SQL server database. DB operation use JDBC with dynamic SQL string. Example:
Select Column from tab where column=StringParm
StringParam is user input. if the stringParm include apostrophe, Java app will throw exception and said Can't execute the SQL.
How to resolve this problem with no java code changing?
...
Hi,
There is any chance to pass arrays to SQL Functions from .NET C#.
Thanks in advance.
Sincerely.
And Could you show me how ?
...
Given a table Records with the columns id int, Type int and Name varchar(50), I can make search queries like so:
SELECT id, Type, Name
FROM Records
WHERE Name LIKE '%Foo%'
To tweak the performance a little, I'd like to give only a limited amount of results; currently 100 — simply by adding TOP 100 to the statement. This, however, can ...
Is there a more efficient way of doing the following SQL?
I want to select the top 50 results, but I also want to set a variable to tell me if I would have gotten more results back without the TOP
DECLARE @MoreExists BIT
SET @MoreExists = 0
DECLARE @Count INT
SELECT @Count = Count(*)
FROM MyTable WHERE ... --some expensive where ...
In SQL 2008 the Backup Database Maintenance Plan Task has a collection property called "SelectedDatabases"
I would like to pass a single value database name to this property.
However the property requires a collection not a string.
Is there anyway I can return a collection from the Expression Builder to achieve this.
...
Which Datatypes are not supported in SQL Server 2008 while creating trigger
...
I am looking into using the datetimeoffset for SQL Server 2008. According to the MSDN article there is a time zone offset range of -14:00 through +14:00. I can understand going 12 hours from UTC in each direction, one hour per timezone. I think I understand 13 hours in each direction, for daylight savings time. I just dont get 14 hours?
...
Hi Group,
I have been working away for the last 7 months on a C# ASP.NET using Visual Studio 2008 and SQL Server 2008.
Today, I was running part of my application which was previously running and I got the following error:
The SELECT permission was denied on the object 'Address', database 'CNET_85731', schema 'dbo'.
I walked through ...
I need to delete databases whose name start with "In"...
I Tried "Like" but it is throwing syntax errors...
I tried following command but throwing syntax errors for "name"
SELECT 'DROP DATABASE ' + name + ';' from sys.databases where name like 'In%'
...
Using a VBA script in Excel, I'm trying to insert a new row into a table and then get back the identity value of that row. If I run:
INSERT INTO DataSheet(databaseUserID, currentTimestamp)
VALUES (1, CURRENT_TIMESTAMP);
SELECT SCOPE_IDENTITY()
in Management Studio, the row is inserted and it gives me the returned identity value as exp...
We are dealing with an application that needs to handle global time data from different time zones and daylight savings time settings. The idea is to store everything in UTC format internally and only convert back and forth for the localized user interfaces. Does the SQL Server offer any mechanisms for dealing with the translations given...
I need to give read only permission to a couple of users on the database so that they can get an understanding of the schema, logic in SPs, etc. But I do not want them to modify anything. I tried assigning the db_datareader role but it doesn't allow viewing SP name or code. What is the right role-combination to do this or do I need to wr...
Hi,
my config file below: very strange, i have spent a day to find out where i am wrong, but still not working, it still not log anything in the database,but i can output them using RollingFileAppender. Also, the store procedure WriteLog is working well.(I have tested it using sql server studio). I have tried to change the connectionTyp...
I've got a table of points, each with a name, latitude, longitude, and an area code. What I'd like to do is perform an aggregation (i.e. a "group by" clause) and return a polygon containing all the points for a particular area code.
I'm struggling a little to even find if there are any built in aggregations for the geography data types...
I have a trigger on a view that handles update operations. When I use the MS Management Studio and do an insert I get this error:
Msg 50000, Level 16, State 10, Procedure Trigger_TempTableAttr_Lot_UpdateDelete, Line 166
Violation of UNIQUE KEY constraint 'UK_Lot_LotAccountCode'. Cannot insert duplicate key in object 'app.Lot'.
Msg 3616,...
Hi
Is anyone know any good reference or general help for sql server 2008 ?
thank's in advance
...
Hello everyone,
I am using SQL Server 2008. I have a table which has a datetime type column called CreateTime. I need to select all the records from this table whose CreateTime is more than 3 days and half an hour from current time (UTC time). I am using T-SQL store procedure.
BTW: The CreateTime column is some time in the past time.
...
I am using SQL Server 2008 and I need to run a SQL Job from SQL Server Agent. I am new to SQL Server Job and I want to execute a stored procedure regularly from a SQL Server Job. But I did not find where to specify the executed stored procedure other than copy & paste SQL commands.
Here is my screen snapshot,
Any ideas how to assign ...
Hello everyone,
I am using SQL Server 2008 and I want to test the execution correctness of my SQL Server Agent job immediately to ignore the schedule. Any ideas?
thanks in advance,
George
...
I need a user defined function to insert a new record and return the Id, is this possible and how do I do it?
I have tried creating a function with the insert statement but I am getting the following error:
Invalid use of the side-affecting operator 'INSERT' within a function.
I am using SQL server 2008.
UPDATE SQL:
CREATE FUNCTION...