|
Hi
I have a SQL view that returns different results depending on how I run it. If I run it in Design mode, all of the records in some of the columns come back as NULL. However, when I SELECT TOP 1000 rows from the view, the records in these columns are returned with the correct values. Any ideas why this happens?
|
|
|
|
|
What is your database?
What is your client (app or SSMS) or ?
It may be caused by the transport layer not liking the volume.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Etienne_123 wrote: some of the columns come back as NULL. However, when I SELECT TOP 1000 rows
from the view, the records in these columns are returned with the correct values
Sounds like a data conversion issue.
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
|
|
|
|
|
hi all,
i use a sql server 2008 import data, to import my database from access, but my access database always change because my application work over it. i want a way to make sql server 2008 import data to work automatically as the changes of the access database.
please help me, if you know any way to create the automated import data from sql server 2008
thanks all
|
|
|
|
|
In order to sync, you must prepare a window service.
Window service will continue to update your sql server database accorting to the time interval mentioned.
|
|
|
|
|
Your requirement does not state whether the SQL database is updated from multiple access databases or your application can update both the access (single use, disconnected) and the sql database when linked to the server/network.
This dictates quite different solutions.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If you have the time to make modifications, you can change the access database into an access project database. In access project, the data is not stored in access rather the data is stored to SQL Server. The project database just lists database objects(tables, views and stored procs)
|
|
|
|
|
SQL Server comes with "SQL Server Integration Services" which is commonly referred to as SSIS.
One commonly uses SSIS for data migration tasks. A very general outline of your solution would involve.
1. Create the migration task.
2. Schedule it so it runs repeatedly.
The following is a tutorial which which teaches SSIS basics as well as creating a data migration task.
http://technet.microsoft.com/en-us/library/ms365330.aspx[^]
|
|
|
|
|
Hi,
I have a following file names in my database.
TestDocument _ 1 _ 0
TestDocument _ Evidence
Test45
123_publish
when i am entering the Test_ in the DocumentName textbox it is forst converted to uppercase and send to the query and query has following expression which returns all record where it should not have to return any record.
please tell me the changes in the following expression.
I am using the Oracle10g database.
UPPER(DOC.ORIGINAL_FILE_NAME) like '%TEST_%'
Thanks,
Umesh Tayade .
|
|
|
|
|
OK, I've already answered this in the C# forum, but I'll answer it here as well. As you are aware, the _ is a wildcard character, so it matches any character. If you need to match the _ as a valid character, then you need to escape it with the \ character, which means that your query becomes:
UPPER(DOC.ORIGINAL_FILE_NAME) like '%TEST\_%'
|
|
|
|
|
Another alternative is to enclose it using []
Example
like '%TEST[_]%'
string str = "TEST_"
str= str.Replace("_", "[_]");
|
|
|
|
|
I am having problems with the following SQL command:
SELECT * FROM Classes
---Works like a charm
SELECT * FROM Classes WHERE Class_Number = 2222
---Fails with this error:
System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting the nvarchar value '11-1111' to data type int.
---I can understand that. Without quotes, sql thinks the Class_Number column is of type int (its actually nvarchar). So let me add quotes...
_______________________________
SELECT * FROM Classes WHERE Class_Number = "2222"
---Fails with this error:
System.Data.SqlClient.SqlException (0x80131904): Invalid column name '2222'.
Now that error has me stumped!!!
What am I missing here?
|
|
|
|
|
Use single quote '2222'
david
|
|
|
|
|
Thanks, that worked. Kind of funny how simple that was. In the time it took to get a response, I wrote a complicated Regular Expression Validator control to get around the issue..... Let me go delete that. lol
|
|
|
|
|
Hi,
anyone which database LinkedIn is using to store thier huge amount of records?
Thanks,
Jassim
|
|
|
|
|
Why not just ask them?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
LinkedIn use a variety of database technologies, including Oracle, MySQL and their own Voldermort. You can find more information in this[^] thread.
|
|
|
|
|
Damnit Pete, you said his name. You know it's cursed right?!
Craigslist Troll: litaly@comcast.net
"I have a theory that the truth is never told during the nine-to-five hours. "
— Hunter S. Thompson
|
|
|
|
|
Hi,
anyone tried installing mySQL on Windows 2008 Server R2 64bit? what's your feedback?
|
|
|
|
|
Thanks in advance,
I have a SQL Server 2005 standard Edition installed on a Win XP Professional OS , and i want to connect a client having Win 7 home OS , but i am unable to connect to the Server , i tried all the options like Remote connections etc are enabled also but it is not connecting.
I tired to check Connection through ODBC with Name Pipes options it worked but did not work with TCP/IP while in my surface area connections its ticked to connect through both Named PIPES and TCP/IP. other machines are working fine
but on this PC i am unable to connect. Any suggestions.
I installed SQL Express and tried to connect to that Instance on Remote PC (XP) but its not connecting even through SQL Express.
SOFTDEV
Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
|
|
|
|
|
Firewall on Win7 blocking port TCP/1433 maybe?
Look in the Win7 event logs and/or the firewall logs.
|
|
|
|
|
Good evening all
i have an image in my select fields, and i know that the Group by clause cant take the Image field, i have a query that looks like this
SELECT
K.KIDID,
K.STUDENTNUMBER,
KIDNAME,
KIDLASTNAME ,
SC.SCHOOLNAME ,
KIDGRADE ,
KIDCLASS ,
SC.SCHOOLID,
k.TEMP_BARCODE,
PHOTO,
A.ACCOUNTID
,SUM(TRANSACTION_AMOUNT) AS [BALANCE]
FROM
KIDS_DETAILS K
INNER JOIN SCHOOL SC
ON K.SCHOOLID = SC.SCHOOLID
INNER JOIN PARENTKID PK
ON PK.KIDID = K.KIDID
INNER JOIN USERS U
ON U.USERID = K.USERID
INNER JOIN ACCOUNTS A
ON A.USERID = U.USERID
INNER JOIN ACCOUNTRANSATIONS AT
ON AT.ACCOUNTID = A.ACCOUNTID
LEFT OUTER JOIN KIDSPHOTO KP
ON KP.KIDID = K.KIDID
GROUP BY
K.KIDID,
K.STUDENTNUMBER,
KIDNAME,
KIDLASTNAME ,
SC.SCHOOLNAME ,
KIDGRADE ,
KIDCLASS ,
SC.SCHOOLID,
k.TEMP_BARCODE,
A.ACCOUNTID,
PHOTO
now as you can see there is a part where i sum , but now i have a PHOTO column, how can i remove this with out getting the common exception that will tell me that Photo is not in
Column 'KIDSPHOTO.PHOTO' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
and if i include it i will get the group by Clause limitation of the Type Text , image
Msg 306, Level 16, State 2, Line 40
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I got a Solution by casting the Field
Select
KIDID,
STUDENTNUMBER,
KIDNAME,
KIDLASTNAME ,
SCHOOLNAME ,
KIDGRADE ,
KIDCLASS ,
SCHOOLID,
TEMP_BARCODE,
Cast(PHOTO as Image) as [PHOTO],
ACCOUNTID,
Balance
From
(
SELECT
K.KIDID,
K.STUDENTNUMBER,
KIDNAME,
KIDLASTNAME ,
SC.SCHOOLNAME ,
KIDGRADE ,
KIDCLASS ,
SC.SCHOOLID,
k.TEMP_BARCODE,
Cast(PHOTO as Varbinary) Photo, ---- Some Changes
A.ACCOUNTID
,SUM(TRANSACTION_AMOUNT) AS [BALANCE]
FROM
KIDS_DETAILS K
INNER JOIN SCHOOL SC
ON K.SCHOOLID = SC.SCHOOLID
INNER JOIN PARENTKID PK
ON PK.KIDID = K.KIDID
INNER JOIN USERS U
ON U.USERID = K.USERID
INNER JOIN ACCOUNTS A
ON A.USERID = U.USERID
INNER JOIN ACCOUNTRANSATIONS AT
ON AT.ACCOUNTID = A.ACCOUNTID
LEFT OUTER JOIN KIDSPHOTO KP
ON KP.KIDID = K.KIDID
Group by
K.KIDID,
K.STUDENTNUMBER,
KIDNAME,
KIDLASTNAME ,
SC.SCHOOLNAME ,
KIDGRADE ,
KIDCLASS ,
SC.SCHOOLID,
k.TEMP_BARCODE,
Cast(PHOTO as Varbinary),
A.ACCOUNTID
) X
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Alternatively, you can use this. I'm assuming that the column PHOTO is in the USER table. I see that some of the columns in the query have not been prefixed with an alias, it is always a better practise to prefix all column names with alias, it improves performance too...
SELECT
K.KIDID,
K.STUDENTNUMBER,
KIDNAME,
KIDLASTNAME ,
SC.SCHOOLNAME ,
KIDGRADE ,
KIDCLASS ,
SC.SCHOOLID,
k.TEMP_BARCODE,
(SELECT PHOTO FROM USER UP WHERE U.USERID = UP.USERID) AS PHOTO,
A.ACCOUNTID
,SUM(TRANSACTION_AMOUNT) AS [BALANCE]
FROM
KIDS_DETAILS K
INNER JOIN SCHOOL SC
ON K.SCHOOLID = SC.SCHOOLID
INNER JOIN PARENTKID PK
ON PK.KIDID = K.KIDID
INNER JOIN USERS U
ON U.USERID = K.USERID
INNER JOIN ACCOUNTS A
ON A.USERID = U.USERID
INNER JOIN ACCOUNTRANSATIONS AT
ON AT.ACCOUNTID = A.ACCOUNTID
LEFT OUTER JOIN KIDSPHOTO KP
ON KP.KIDID = K.KIDID
GROUP BY
K.KIDID,
K.STUDENTNUMBER,
KIDNAME,
KIDLASTNAME ,
SC.SCHOOLNAME ,
KIDGRADE ,
KIDCLASS ,
SC.SCHOOLID,
k.TEMP_BARCODE,
A.ACCOUNTID
|
|
|
|
|
Hi,
To get some more structure in my window form application, I want
to move a DataSet in a custom "DAL" folder.
For some reason I cannot reopen the Dataset in the designer.
Get following error :
"Value does not fall within the expected range".
When I place it in the root folder everything works fine.
Why ?
TIA
|
|
|
|
|