I want to compare and select a field from DB using Like keyword or any other technique.
My query is the following:
SELECT * FROM Test WHERE name LIKE '%xxxxxx_Ramakrishnan_zzzzz%';
but my fields only contain 'Ramakrishnan'
My Input string contain some extra character xxxxxx_Ramakrishnan_zzzzz
I want the SQL query for this. Can any ...
I have a table with large number of rows(~200 million) and I want to process these values in c#, after reading them from memory. Processing requires grouping entries by column values in a way that can't be done inside the sql server itself. Problem is that reading the whole data at once gives me a OutOfMemory exception, and takes a lot o...
I am currently looking for some code or a tool/service that allows me to store Log4Net Messages in a SQL Server database. Does something like this already exist or would I have to implement this on my own? I couldn't find anything on SO or Google.
Thanks in advance for any information.
...
I'm sure this is something really simple that I'm overlooking, but MS SQL is new to me -- I am (or at least thought I was) fairly comfortable with basic MySql though.
SELECT l.link_id, l.link_allcount, d.desc_id, d.desc_count, d.desc_text, h.hour_17, dl.day_19
FROM lnktrk_links AS l, lnktrk_hourly AS h, lnktrk_daily AS dl
LEFT JOIN ...
Lets say we have a Table A with primary key column ID. Now this table is in a foreign key relationship with say n other tables on this column.
I need to create a stored procedure which will take an ID as parameter and return 1 or 0 depending upon the value of ID present in any other table.
So for ex if ID =3 and any of the n tables con...
The situation I am in is that I have a set of existing tables with incrementing Integers as Ids. I have now added a GUID to each table to be the new PK.
I have a primary table
dbo.ParentTable(GUID - PK, ParentTableId INT, Name VARHCHAR)
and a child table
dbo.ChildTable(GUID - PK, ParentTableId INT, other fields.....)
and want ...
i have a contact us table containing name emailid phoneno message repliedmessage as fields, by default the replied message field is null after replying to a particular message i am updating that field but at the same time i also want to retrieve the other values also like name and emailid using select statements
...
Hi there!
I'm writing a log parser for an asp.net mvc2 web application. I use Entity framework as a model and logging is done both using my manual engine together with SqlServer2008 CDC feature.
When inserting, or editing a row in a database, the action is being logged. However, there's a small lag between occuring changes in actual ta...
From SQL Server 2005, I need to do an export for a client to an xml-like format shown below. Why they are not using XML, I don't know. Any ideas on how to do this quickly without exporting the file "FOR XML" and then writing a messy script to go through the text file and find and replace <, >, and every closing XML tag? Thank you.
STA...
I need a query that will alter a single column from nvarchar(max) to 32. The real problem is this table has 800,000 rows. And my alter table myTable alter column mycolumn statement times out. Any suggestions or tips?
...
My understanding is that some of the DMV's in SQL Server depend on query plans being cached. My questions are these. Are all query plans cached? If not, when is a query plan not cached? For ones that are cached, how long do they stay in the cache?
Thanks very much
...
I have the following table in my database:
tbl1
PK
ClientID
ScheduleDay
Time1Start
Time1Stop
Time2Start
Time2Stop
Time3Start
Time3Stop
Status
Here is some sample data
ID ClientID ScheduleDay Time1Start Time1Stop Time2Start Time2Stop Time3Start Time3Stop
-- -------- ----------- ---------- --------- ---------- --------- ---------- -...
I am getting a very strange error message at one of our client sites and I am having very little luck trying to figure out what is going on.
Hr=80040154 ERR:OpenDB failed getting
pub version 28627
That is the error message that is from the Merge Agent (IIS) logs. From what I can tell, it is a COM error not being able to load a s...
i have a procedure in which the below condition is to be written in a WHERE clause. How do I do that using CASE, or something like it?
IF (@itemId IS NOT NULL)
dataId = @itemid
...
I am working with an application where we store our client data in separate SQL databases for each client. So far this has worked great, there was even a case where some bad code selected the wrong customer ids from the database and since the only data in the database belonged to that client, the damage was not as bad as it could have b...
Hi,
I have some Selenium test scripts which I'm using to test a Classic ASP web app, but I'm having problems after restoring the database (SQL Server 2005) with a backup file before every test is run. Immediately after the successful RESTORE (from a Python script running sqlcmd ...) when the ASP tries to connect to the db I get the foll...
I'm working on a .NET component that gets a set of data from the database, performs some business logic on that set of data, and then updates single records in the database via a stored procedure that looks something like spUpdateOrderDetailDiscountedItem.
For small sets of data, this isn't a problem, but when I had a very large set of ...
With SQL Server 2005 and 2008 is it possible to set the default schema from the connection string? It'd be a lot easier if we didn't have to manually set the schema with SQL code.
...
I want to use CLR table-valued function in SQL Server 2008, which accesses a database from inside itself. I've got a permission exception. I am trying to execute function as the same user as under which it was created. So cause of the problem is not clear..
Here is the function:
public partial class MyClass
{
[SqlFuncti...
Sql Server 2008 R2 Express. NHibernate 2.1.2.4.
I get SQL like:
SELECT customer0_.Id as Id1_0_
FROM customers customer0_
WHERE customer0_.Id=@p0;
@p0 = 11111111-1111-1111-1111-111111111111
...which returns 0 records even though there is Customer in there with that Id.
The SQL Server column datatype is UNIQUEIDENTIFIER.
<session-f...