Showing posts with label basic. Show all posts
Showing posts with label basic. Show all posts

Thursday, March 22, 2012

Comparing Dates in Subqueries

Hi,

I am trying to write a basic select query with a subquery.

select x
from y
where DateTime > '27 January 2003'
and DateTime < '02 February 2003'
and a = 'ttt'
and x IN (SELECT x
from y
WHERE a = 'vvv'
and rcd.DateTime > '27 January 2003'
and rcd.DateTime < '02 February 2003')

I only want to see the data for the records where ttt happened before vvv.

Any ideas?select x
from y
where DateTime > '27 January 2003'
and DateTime < '02 February 2003'
and a = 'ttt'
and exists
(SELECT *
from y y2
WHERE y2.a = 'vvv'
and y2.DateTime > '27 January 2003'
and y2.DateTime < '02 February 2003'
and y2,DateTime > y.DateTime
)|||select y.x
from y
left join
(
select x,MinDateTime=min(DateTime)
from y
where a='vvv' and DateTime > '27 January 2003' and DateTime < '02 February 2003'
group by x
) sy on sy.x=y.x and a='ttt' and ( (DateTime<MinDateTime) or MinDateTime is null )sqlsql

Tuesday, March 20, 2012

compare two text files

Dear all,


What software can compare two text files? They are contains about 100k data generated from Visual Basic 6.0 program and MS SQL 2000. I have many files to compare daily. Please give me some suggestions. Thanks.

Alex

I think VSS (source safe) is suitable for that|||

thanks Eisa. it is helpful.

Could you suggest some freewares?

|||Hi Alex,
I don't know if it is allowed to share free software here or not, howere you can serach google for compare text files free|||Thank your for your help|||Windows has a command line utility (fc) that compares two files. Type "fc /?" at a command prompt, and it will list the options/switches. It's a good solution if it has the features you need, because it's built into Windows, and you won't have to bother installing it everywhere you need it. If you want to use it in a job, you can invoke it with an operating system type step, or use xp_cmdshell if you need to call it after dynamically building the command at run-time. In a job, you would have to pipe the results to another text file, for review.|||

CompareIt! - cool

http://www.grigsoft.com/

|||thanks a lot

compare two text files

Dear all,


What software can compare two text files? They are contains about 100k data generated from Visual Basic 6.0 program and MS SQL 2000. I have many files to compare daily. Please give me some suggestions. Thanks.

Alex

I think VSS (source safe) is suitable for that|||

thanks Eisa. it is helpful.

Could you suggest some freewares?

|||Hi Alex,
I don't know if it is allowed to share free software here or not, howere you can serach google for compare text files free|||Thank your for your help|||Windows has a command line utility (fc) that compares two files. Type "fc /?" at a command prompt, and it will list the options/switches. It's a good solution if it has the features you need, because it's built into Windows, and you won't have to bother installing it everywhere you need it. If you want to use it in a job, you can invoke it with an operating system type step, or use xp_cmdshell if you need to call it after dynamically building the command at run-time. In a job, you would have to pipe the results to another text file, for review.|||

CompareIt! - cool

http://www.grigsoft.com/

|||thanks a lot

Wednesday, March 7, 2012

Compact Edition not in Data Source List

After I installed the SQL Server Compact Edition, I start a new VS 2005 Basic project. When I try to create a new connection I do not see the Compact Edition in the list of data sources.

I have installed previously SQL Server CE, Everywhere, Mobile, 2005 Mobile but I uninstalled them all.

Can anyone give me an idea why I can't see the Compact Edition as a data source?

Thanks.

Hello

From what you'r saying maybe you need to re-install the SQL Server CE.
I have the same problem but it's because I'm using VB.NET Express Edition.

see ya

Sunday, February 19, 2012

Committing data to SQL from a Visual Basic Form

I have novice level visual basic knowledge using Visual Studio 2005 and have little knowledge of SQL using SQL express. I am attempting to create a SQL database which initially consists of a single table bound to a Visual Basic form for data entry. So far I have been able to bind a VB form to a SQL database creating a DataSet, DataAdapter, and utilizing the default binding navigator. I also seem to have functioning Stored Procedures.

The VB form is able to add data to the SQL table and I can toggle through the data while the VB app is running but when I terminate the app and load it again all newly added data is not available from the SQL table.

I have seen other strings on this subject and viewed many tutorials but they only bring me as far as I am. None of them address the concept of permanently committing data to SQL from the VB form. FYI…data entered manually into the SQL table is stored, just not data from the form.

Does anyone have any idea what is wrong?

Are you using the user instance feature in SQL Server express ? Then you will have to set the "Copy" property to "Never" for the in your solution included datafile.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

I am not clear on the instructions please clarify for the newbie.

Thanks.

|||If you are starting your program from inside visual basic the application is being rebuilt and the SQL database as created in visual basic is overwriting the database you created last time you ran your program. If you open your program from the bin\debug directory within your project folder, make changes to the data, exit the program, then go back into the program the same way, your database should have been updated with the changes.|||@.Bluebuddha: Did you find the setting ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

Committing data to SQL from a Visual Basic Form

I have novice level visual basic knowledge using Visual Studio 2005 and have little knowledge of SQL using SQL express. I am attempting to create a SQL database which initially consists of a single table bound to a Visual Basic form for data entry. So far I have been able to bind a VB form to a SQL database creating a DataSet, DataAdapter, and utilizing the default binding navigator. I also seem to have functioning Stored Procedures.

The VB form is able to add data to the SQL table and I can toggle through the data while the VB app is running but when I terminate the app and load it again all newly added data is not available from the SQL table.

I have seen other strings on this subject and viewed many tutorials but they only bring me as far as I am. None of them address the concept of permanently committing data to SQL from the VB form. FYI…data entered manually into the SQL table is stored, just not data from the form.

Does anyone have any idea what is wrong?

Are you using the user instance feature in SQL Server express ? Then you will have to set the "Copy" property to "Never" for the in your solution included datafile.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

I am not clear on the instructions please clarify for the newbie.

Thanks.

|||If you are starting your program from inside visual basic the application is being rebuilt and the SQL database as created in visual basic is overwriting the database you created last time you ran your program. If you open your program from the bin\debug directory within your project folder, make changes to the data, exit the program, then go back into the program the same way, your database should have been updated with the changes.|||@.Bluebuddha: Did you find the setting ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

Committing data to SQL from a Visual Basic Form

I have novice level visual basic knowledge using Visual Studio 2005 and have little knowledge of SQL using SQL express. I am attempting to create a SQL database which initially consists of a single table bound to a Visual Basic form for data entry. So far I have been able to bind a VB form to a SQL database creating a DataSet, DataAdapter, and utilizing the default binding navigator. I also seem to have functioning Stored Procedures.

The VB form is able to add data to the SQL table and I can toggle through the data while the VB app is running but when I terminate the app and load it again all newly added data is not available from the SQL table.

I have seen other strings on this subject and viewed many tutorials but they only bring me as far as I am. None of them address the concept of permanently committing data to SQL from the VB form. FYI…data entered manually into the SQL table is stored, just not data from the form.

Does anyone have any idea what is wrong?

Are you using the user instance feature in SQL Server express ? Then you will have to set the "Copy" property to "Never" for the in your solution included datafile.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

I am not clear on the instructions please clarify for the newbie.

Thanks.

|||If you are starting your program from inside visual basic the application is being rebuilt and the SQL database as created in visual basic is overwriting the database you created last time you ran your program. If you open your program from the bin\debug directory within your project folder, make changes to the data, exit the program, then go back into the program the same way, your database should have been updated with the changes.|||@.Bluebuddha: Did you find the setting ?

Jens K. Suessmeyer

http://www.sqlserver2005.de