COUNT command rejected in SQL Query
Tue, 3 Jun 2008 17:41:02 -0700
My C# Windows program does not recognize the COUNT command in a SQL query
string using SQL Server 2005. I can use the command when I code the query
manually against the data base. It rejects the command SELECT COUNT(*) FROM
EARNDED. Does anyone know how to get around this problem?
Dave ...
|
how to upate ntext fields
Mon, 2 Jun 2008 20:21:00 -0700
I have a mssql 2005 database dbTest with to tables tblOne and tblTwo.
tblTwo.IndexID = tblOne.IndexID.
tblOne and tblTwo has both got fields, tblOne.Article and tblTwo.Article
which is set to type(ntext).
tblOne has less records than tblTwo and I would only like to update the
record fields where tblOne occ ...
|
Loop and pivot records
Thu, 29 May 2008 14:14:03 -0700
Hi all,
I have a table that looks like this:
Acct SSN
1 5
1 7
1 10
2 20
2 55
3 1
3 99
I need it to get through this point (I assume with a cursor):
Acct SSN Key
1 5 1
1 7 2
1 10 3
2 20 1
2 55 2
3 1 1
3 99 2
To this point (De-Normalized):
Acct SSN1 SSN2 SSN3
1 ...
|
How to Combine LIKE and IN
Wed, 14 May 2008 07:49:01 -0700
SQL Server 2005.
I want to do a query that will accomplish both a LIKE type search and an IN
type search. I have a variable number of LIKE strings that I want to search
on. I know I can say:
SELECT * FROM <TABLE> WHERE <FIELD> LIKE '0001%' AND <FIELD> LIKE '0002%'
AND <FIELD> LIKE '0003%'
Is there a ...
|
Cannot Reference Named Column in WHERE Clause
Tue, 13 May 2008 11:08:05 -0700
SQL Server 2005.
I have a view defined for a database. Part of the query is:
SELECT dbo.GL7PROJECTS.PROJECTID AS JURISDICTION
I have not problem using JURISDICTION in the ORDER BY clause, but when I try
to use it in a WHERE clause (e.g., WHERE JURISDICTION LIKE '001%') I get an
error (while in the SQL ...
|
Extracting the table names to which a fied is related to
Fri, 9 May 2008 09:50:01 -0700
I am using a database with n tables in it. I have a set of field names with
me. what I want is to find the names of the tables in which a particular
field is mapped to or related to in order to find the effect of a particular
field to the database.
Regards, ...
|
Loop through records
Wed, 7 May 2008 19:56:00 -0700
Hello,
i have a table that has some informatio regarding an office building in it.
It also has the building managers information in it. I want to create two
new tables. One with just the building info, and one with just the managers
info. Now, I have created the two new tables. In the building table, I ...
|
|
|
Data Prompt
Tue, 29 Apr 2008 19:46:00 -0700
As a background:
1) I am using SQL 2005
2) Reporting Services.
In order to achieve certain report requirements I have created 2 VIEWS on
the SQL database.
What I want to be able to do is have a date paramater prompt on one of the
views.
I have created the following SQL but I get an error message whe ...
|
auto lenght
Tue, 29 Apr 2008 12:47:02 -0700
HI
Declare @a char(7)
if the lenght of the inserted value in @a is less than 7. the zero's should
be added on the left side to make it of lenght 7.
set @a = aaaa
then 3 zero's should be added on the left side
As the lenght of @a may vary so how can zero's should be added on the left
side autometica ...
|
Help with Subquery
Mon, 21 Apr 2008 02:09:00 -0700
I am trying to compact some of the views we have in our DB, I am turning 2
views into one, with the use of a subquery. The problem I get is that this
view works fine but won't display any Nulls in the Success Column. The nulls
(converted into zero's) are required as I pass into a script. Not having
these wou ...
|