I know i can use stored procedures to eliminate sql injection attacks but it would bloat the code by more than I'm willing to accept and making it costly to maintain.
In my dynamic sql query, I would like to search a string of text in 2 columns in one of my tables but before that happens, I would like my business layer, which is written...
I have a asp.net web site that was developed on the .Net Framework v2 connecting to sql server 2000. I am trying to migrate it to a new server that has the .Net Framework v3.5 on it along with sql server 2008. I backed up the database and restored it to the new database server. I moved the web site and updated the web.config. Now however...
When it comes to CRUD operations and your database (SQL Server '08), is it better to write the SQL statements into your code or use stored procedures? Why?
As pointed out below, I omitted LINQ as a third option. This was done because I am not familiar with LINQ. . . yet. If LINQ is a better option, please let me know what I'm missing.
...
Windows Azure Data Services supports a subset of TSQL. What are the features of SQL 2008 not supported?
...
I am rebuilding indexes using a script which reorganises or rebuilds indexes according to a predefined fill factor.
It is on SQl 2000.
I have the following SET options in my script:
SET ANSI_WARNINGS OFF
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
I am getting the following error:
DBCC failed because the following SET options have i...
Hi,
Had a good search here but can't see anything that gets my mind in gear for this one.
Basically I have a table call Diaries, this contains fields such as StartTime EndTime, I need to do a calculation that works out the difference in minutes between StartTime and EndTime. then for each row that fits that day I need to add up the res...
When defining a calculated property using a formula in NHibernate, what are the implications for when the formula varies its result depending on the query restrictions, especially with regards to query caching?
More specifically, consider the following simple C# class:
public class Entity
{
public Entity() { }
public virtual in...
Hi all,
Now, I am using Ms sql server 2000 and I want to store my data as the unicode for chinese font. But I don't know it can store this type or not? If not, could anybody guide me?
Thanks,
Sopolin
...
Should I choose the smallest datatype possible, or if I am storing the value 1 for example, it doesn't matter what is the col datatype and the value will occupy the same memory size?
The question is also, cuz I will always have to convert it and play around in the application.
UPDATE
I think that varchar(1) and varchar(50) is the sa...
work on Sql server 2000. i want to get the current server date and time then want to compare it with my table column EntryDate .How to?
Declare @id datetime
Select @id = DATEPART(hour,GETDATE())
SELECT [Name],[BirthDate],[Email]
FROM Customers3 where BirthDate<=@id-1 AND BirthDate>=@id
want to get on the range value like @id=10.I wa...
I am using SQL Server 2008 express edition and its collation settings are set to default.I wish to store special characeters like á ,â ,ã ,å ,ā ,ă ,ą ,ǻ in my database but it converts them into normal characters like 'a'. How can I stop SQL Server from doing so?
...
in MySQL
select * from record where register_date like '2009-10-10%'
What is the syntax in SQL Server?
Thank you.
...
SQL server Agent is not starting......
In the SQLAGENT log i found this error.......
2009-10-24 22:49:36 - ? [393] Waiting for SQL Server to recover databases...
2009-10-24 22:49:40 - ! [298] SQLServer Error: 5845, Address Windowing Extensions (AWE) requires the 'lock pages in memory' privilege which is not currently present in the ac...
Hello!
I have a problem using the SSIS. I try to import data from database one to database two. Therefore I use a OLE DB Source with the following command:
SELECT Name, Description, JobID
FROM DBone.Table
My problem is, that I only want to import new data from this source. So I use a second OLE DB Source withe the following command...
I have the following SQL. Tables defined.
#tbContinent
--------
ContinentID | ContinentName
AddressInCountry
--------
AddressID | CountryID
AddressInContinent
--------
AddressID | ContinentID
NameInAddress
--------
AddressID | NameID
I then have the following SQL:
--- Insert into tbName
DECLARE @tbName TABLE
([ID] int, [Add...
Hi folks:
My clients need a format of serial #: YYYYMMDD098 where YYYYMMDD represents today, 098 is a 3-digit number that will get increased by 1 every time we access the serial #.
Furthermore, the 3-digit # will trun back to zero every day.
Where can I find a reference for this solution?
Thanks.
...
In SQL server (2000 & 2005 ) What is the difference between these two queries ? Which one I should opt on which scenarios ?
Query1:
Select EventId,EventName from EventMaster where EventDate BETWEEN '10/15/2009'
and '10/18/2009'
Query2:
Select EventId,EventName from EventMaster where EventDate >='10/15/2009' and
EventDate <='10/18/...
Hi there,
I'm trying to move some data between two SQL Server 2008 tables. If the record exists in Table2 with the email from Table1 then update that record with the data from Table1, else insert a new record.
In Table1 I have a number of columns; firstname, surname, email and so on.
I'm not quite sure how to structure the query to up...
Using VB6 and SQL Server 2005
I want to write a sql connection for connecting to other system sql server.
Code
ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=STAR;Data Source=" & SName & ""
In SName - Am giving a Server Name
The Above connection code is working for the...
Hi.
I have a Name table with the columns
NameID
Name
TypeID
With the following SQL
SELECT[NameID]
FROM[Name]
WHERE[TypeID] = @TypeID
AND NameID >= (SELECT MIN([NameID])
FROM [Name]
WHERE [Name]='Billy' AND [TypeID]=@TypeID)
Ive been asked to convert this to an Inner Join without using any nested select but n...