Using VB.Net, C#.Net and SQL Server.
Windows Application
I want to separate a code for 3 Tier Architecture(Presentation Layer, Data Access Layer,
Business Logic Layer).
Code.
Form_Load
Dim cmd As New SqlCommand
Dim ada As New SqlDataAdapter
Dim ds As New DataSet
Con = New SqlConnection("Data Source='" & servername....
I have suddenly faced a problem with moving some records in a SQL Server database from one table to another, using LINQ to SQL. Is it possible to write in LINQ to SQL a query just as simple as this:
INSERT INTO Table2 SELECT * FROM Table1 WHERE Selected = 1
GO
DELETE FROM Table1 WHERE Selected = 1
GO
without using loops and collectio...
I have a two column table with a primary key (int) and a unique value (nvarchar(255))
When I insert a value to this table, I can use Scope_identity() to return the primary key for the value I just inserted. However, if the value already exists, I have to perform an additional select to return the primary key for a follow up operation (i...
Hi All,
I am using Sql Server mode to store the session information of the application. After adding session information I am able to see the data in the ASPStateTempSessions table, but when I try to retrieve the same information of the stored sessions Iam not able to retrieve the information from the other application.
How can I acces...
Hello USers
i am stuckd in one place in my biztalk solution,
i have an orchestraion in which i am getting data from sql server (using generated schmema),and it its connected to decide shape,in which i have checked one of my database status column (by promoting property,as it is sql generate schmea i had to delete MAXOCCURENCE=UNBOUND),...
Hey peeps.
Thanks in advance!
I have a Function in SQL server 2008 which splits a string based on the char i give. Lovely and simple. When I pass in:
Content1,Content2,Content3
I can create a lovely temp table with those values in a single column split by the comma (,).
Now, that's all good, but I now need to split the following in...
Hey guys!
I have the following code in SQL (2005) which calculates the avarage user logins on a systm:
with
user_total as
(
select COUNT(distinct ID) as counter
FROM [dbo].[LOG]
where [LOG].DESCRIPTION='Login success.'
AND
Convert(datetime,convert(char(10),[LOG].CREATED_ON,101)) BETWEEN '2009-01- 01...
I need to write a Mac Objective-C/Cocoa app that connects to a remote MS SQL Server. How to do it?
Also, how to run SELECT/UPDATE/INSERT/DELETE in this connection?
...
I'm not sure there is this exact situation in another question, so sorry if this a duplicate. I have a problem with the Category system I am using I have the following query (for example)
SELECT DISTINCT COUNT(StockID)
FROM tblStock
WHERE CategoryCode IN (
SELECT CategoryCode
FROM tblLookup
WHERE CategoryID = 'EG')
I need to do a pa...
I have a column with data in a special “format”. Example:
L100000
L50
L5
S10
S15L10
S20
S90
S10
S10L5
S10L40
S10L5
The value consists of an “S” and/or an “L”, each with a number following the letter.
I need to write a query, which will return two columns, “S” and “L”, which will have only the coresponding numeric value following the l...
Sometimes I need to treat the same table as two separate tables. What is the solution?
...
What is the best way to create an Empty DataTable object with the schema of a sql server table?
...
Sometimes we can write a query with both derived table and temporary table. my question is that which one is better? why?
...
Hello,
I'm writing a stored procedure containing SQL Select queries with some functions on some columns and a GROUP BY clause.
Obviously, I have to repeat these functions in the GROUP BY, which dramatically decreases code readability and increases redundancy.
So far, an alternative I have found was to use a derived query so I can acces...
I'm using SQL Server 2008 and Access 2010 beta - but this problem occured with SQL Server 2005 and Access 2007 as well.
I have an Access adp connection to the SQL Server. I create a view that does a group by and sums a column which is type numeric(7,2). The result of the sum expression is inexplicably treated as text by Access. In SQ...
I have an application that sends data based on user interaction (not user input). The data sent could be an Integer, String, Date, or Boolean value. There are 140 keys. We may get anywhere from 1 key value pair to all 140 at a time.
We want to store everything but will only be using 20 out of 140 keys within the application. The remaini...
I would like to extract some data from three tables in a SQL Server 2005 database. While this can surely be done in code, it seems like this could be done reasonably well in SQL (bonus points for LINQ!).
Basically, I would like to know for each month how many calls and meetings each employee has held with each of our clients. Somethin...
Hey guys,
I am trying to work on the upgrade component in our program.
This requires changing an index's name
EXEC sp_rename N'Sig_Summary1Index.IX_Sig_Summary1Index_StartTime',
N'Sig_Summary3Index.IX_Sig_Summary1Index1_StartTime', N'INDEX';
(we need to remain compatible with SQL SERVER 2005)
and then check if it exists in the same...
Update: After some experimentation, it appears that the thing that is slow is when I call "SELECT min(column) FROM theTableValuedFunction()".
I'll call the local server ServerLocal and the other remote server ServerForeign. I have a SQL query in a table valued function on ServerLocal that looks like this:
SELECT columns
FROM ServerFo...
All of my tables have certain audit columns (CreateDate,CreateBy,UpdateDate,UpdateBy)
Since they just take up visual space, is it possible to somehow hide these columns so they do not show up in a database diagram in SSMS or SSMSE?
...