|
hello
p
|
|
|
|
|
|
Look in the SQL Server documentation for CAST or CONVERT
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Hello All,
I've downloaded and installed SQL 2005 Express a week ago. Now, I've downloaded the SQL 2005 Management Studio Express. It complains that it only works with SQL 2000 and SQL 2005. Am I stuck with sqlcmd.exe for creating databases in SQL 2005 Express?
Any help is appreciated.
Paul
|
|
|
|
|
It so turns out that I installed a version of SQL 2005 Express from October, and Management Studio Express needed the latest release from Microsoft.
So I've got it working now 
|
|
|
|
|
I inserted three records into table Products(ProductID, ProductName) with ProductID set to AutoIncrement.
Three records with ProductID were 1, 2, 3.
After that i deleted three recored and insert the fourth record. This record would got the the productID's value is 4
How could i set the ProdudctID of this record to 1, just like the beginning.
Thanks
|
|
|
|
|
vuthaianh wrote: How could i set the ProdudctID of this record to 1, just like the beginning.
I’m guessing you’re using MS Access; the only way to re-start the counter is to compact / repair the database. It only works when there are no other data connections open and when no records exist in the table.
Hope this helps.
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Hi All,
Thanku for ur quick n speedy response................
Here I came with a question......
I have table called -- Client
a column is there that is --- clientCode navarchar(15)
Another table user_ref
in this I have UserID as primary key...
Now wht i have to do is I have to get clientCode from Client table to user_ref table and
I have to make (userID,clientCode) as primary key.
hope u all got the query
pls tell me ASAP
thanku
sangeetha
sangeetha
|
|
|
|
|
|
I'm making assumptions here it not very clear what you require
Run an update with two tables :
-------------------------------
update user_ref
SET user_ref.clientCode = Client.clientCode
from user_ref client
WHERE user_ref.USERID = Client.USERID
|
|
|
|
|
I have this:
With Me.daNumCourses.SelectCommand
.CommandText = "SELECT Section.Section_ID, Section.InstructorID, Instructor.ID FROM Section INNER JOIN Instructor ON Section.InstructorID = Instructor.ID AND Section.InstructorID = '" & Me.instr.ID & "'"
intCount = .ExecuteNonQuery()
End With
Me.dsNumCourses.Clear()
Me.daNumCourses.Fill(Me.dsNumCourses)
Me.txtNumberCourse.Text = intCount
I keep getting -1 so what am I doing wrong?
Thanks
|
|
|
|
|
Why are you doing this? Why not just fill the data set and get a count of the rows in the DataTable? e.g. dsNumCourses.Tables[0].Rows.Count
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
I just want to get the count of the classes that a certain instructor teaches. I tried the .count property and that counts all of the rows in a particular table.
Thanks for your reply. If you have a suggestion on how to do that please post back.
|
|
|
|
|
Why don't you have your SQL as:
SELECT COUNT(*) FROM ....
Also, the way you build your SQL is suscepatable to a SQL Injection Attack and you should try and use parameterised queries where ever possible. You can read more on how to improve the security of your application here: SQL Injection attacks and tips on how to prevent them[^]
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
How do you return the number of rows from the query? In other words if I have a variable intCount how do I set intCount to the "count" of the query?
Thanks for your reply. We've noticed a few security holes in our application in a few places and we are fixing those right now.
|
|
|
|
|
Dim cmd As SqlCommand
cmd = SqlCommand.New()
cmd.CommandText = "SELECT COUNT(*) FROM MyTable WHERE someColumn=@someValue"
cmd.Connection = myConnection
Dim numRows As Int
numRows = cmd.ExecuteScalar()
numRows will contain the number of rows that match the given filter (i.e. what is filtered in the WHERE clause). COUNT() is an aggregate function that returns a count, when COUNT(*) is used it returns the number of rows. If you use COUNT(columnName) then it will count the number of rows where the column value is not null.
Does this help?
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
This is the correct way. ExecuteNonQuery should be used for Insert/Update/Delete statements. If the CommandText is "SELECT" statment, then it will always return -1. When it is DML statement, then it will return the number of rows affected by that DML statement.
|
|
|
|
|
I have a program that converts excel to mssql. Does anyone know how to properly use it step-by-step?
|
|
|
|
|
vandread1 wrote: I have a program that converts excel to mssql. Does anyone know how to properly use it step-by-step?
I think you win the prize for the most vague question of the day.
vandread1 wrote: a program
"A program"? The indefinite article? Could you tell us to which program you are referring?
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
vandread1 wrote: I have a program that converts excel to mssql. Does anyone know how to properly use it step-by-step?
Peers over your screen looks, I don’t see any program running that converts an Excel file to SQL server.
Is that you need to create a program that inserts data into a SQL table? What language are you planning on using? Which data connectivity model do you need to use?
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Please im working on smart devices application on C# and i want to know how i can connect a database with it as the windows application.
im trying to use Using System.data.oledb
or Using System.data.sql
But no response.
so please please help me.
thanx and wish u solve me this problem
tedy
|
|
|
|
|
Follow this
http://www.csharphelp.com/archives3/archive586.html
Hope this helps
|
|
|
|
|
Hi all,
i am developing the website in ASP.NET using MS Access database, in this project client require ,at the end of every day the database should send a report via email of the upated record , means new user, new transaction etc to client automatically....
so any idea for this...
thanx
|
|
|
|
|
You can write a script (Javascript or vbscript) that sends the mail, and then schedule that script to run every day.
Wout Louwers
|
|
|
|
|
thanx for reply,
but how i can schedule that script to run every day in asp.net, its a main problem......
|
|
|
|