|
Hi,
you can use sp_executesql N'exec <stored_procedure_name>'
where <stored_procedure_name> is constructed as @DBName.dbo.GetContacts
You can also pass parameters on this way. Take a look at http://msdn2.microsoft.com/en-us/library/ms188001.aspx
Best regards,
DLM@bypsoft.com
|
|
|
|
|
Can anyone tel me what is the difference between Number datatype and integer datatype in Tsql and how much the capacity they are having??
prasannaarumugam
|
|
|
|
|
Do you mean numeric? If so, the numeric datatype can have a precision.
An int is stored in 4 bytes and has the capacity of -2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647). The numeric is functionally equivalent to the decimal datatype, and when maximum precision is applied, valid values range from - 10^38 +1 to 10^38 - 1.
All of this information was easily identifiable in SQL Server Books On-line or Google. Please use those as your first port of call next time and don't ask us to do your research for you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have several excel files(*.xls) that I'm extracting data from using Visual Basic and I'm having problems with my SQL statement. I would like to do a count & group by in the statement to input this data into a control sheet but I continue to get an error message when filling the dataset.
Error: An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in microsoft.visualbasic.dll
Code Snippet:
Function groupxls(ByRef xlfile As String, ByRef xlsfile As String)
Dim ex1 As String = "Provider=Microsoft.Jet.OLEDB.4.0; " & "data source=" & xlfile & ";" & "Extended Properties=Excel 8.0;"
Dim conn1 As New OleDbConnection(ex1)
Dim dtset1 = New DataSet
Dim flnme As String
y = xlsfile.LastIndexOfAny(".")
flnme = xlsfile.Remove(y, 4)
Dim col1 As String = "sc_typname" '<-----Column to group by
Dim MyCommand1 As New OleDbDataAdapter("select count(*) from flnme group by col1", conn1)
MyCommand1.Fill(dtset1)
DataGrid1.Refresh()
DataGrid1.DataSource = dtset1.Tables(0)
conn1.Close()
conn1.Dispose()
End Function
If anyone can take the time to look at this for me please know that it will be very much appreciated! Thanks in advance!
Swish
|
|
|
|
|
Swisher24 wrote: Dim col1 As String = "sc_typname" '<-----Column to group by
Dim MyCommand1 As New OleDbDataAdapter("select count(*) from flnme group by col1", conn1)
You are passing the name of the variable to the query string instead of the value of the variable, try the following:
Dim MyCommand1 As New OleDbDataAdapter("select count(*) from flnme group by " + col1, conn1)
|
|
|
|
|
Thanks aztekka!
I tried this sql statement and I'm still getting an Unhandled Exception Error. I'm thinking that VB 2003 doesn't like the statement somehow. I will continue to work on this and any more help that can be provided will be very appreciated.
Swish
|
|
|
|
|
Hi every body
I have a question about using typed DateSet in web application? Is it a good approach to use a typed DataSet in web app(i mean making dataset with wizard in .NET 2.0).Does it based on oop concepts? If not, what is the best way for accessing data in a web app? Another point is that i want to use 3layer programming,I read that this way will make a data layer.Am I right?I don't know the advantages and disadvantages of this approach.I will be apprisiate if you help me.
Regards
Masoumeh
|
|
|
|
|
can any one tell me how to pass the output parameter in the execution statment in sql. and explain the details about that..
prasannaarumugam
|
|
|
|
|
exec SP_storedProcedure 2,2,@outParameter out
Rami Abdalhalim
|
|
|
|
|
Example:
exec SP_storedProcedure 2,2,@outParameter out
|
|
|
|
|
THANKS FOR YOUR ANSWER
prasannaarumugam
|
|
|
|
|
Hi.
Any idea what happens if multiple instances of an application try to insert records into the same table of a database at the same time?
Will all of them succeed? Will only the first one to come be allowed to do it?
Is there any chance to screw up the database?
PS: I am using Access at the moment, but the question is also for SQL Server and MySql.
Thank.
|
|
|
|
|
blackjack2150 wrote: Any idea what happens if multiple instances of an application try to insert records into the same table of a database at the same time?
Will all of them succeed? Will only the first one to come be allowed to do it?
Is there any chance to screw up the database?
In answer to your questions:
Yes.
Maybe
Maybe
Yes
If multiple inserts are performed at the same time the first will lock the table and the others will wait for access.
If the update is quick enough all will succeed. If the update operation takes too long some INSERTs may fail becuase they timed out.
And there is the opportunity to screw up the database. If you update the same bits of data in different ways only the last update will persist as it overwrites the previous updates. This may not be what you want.
|
|
|
|
|
I was affraid so.
Thanks!
|
|
|
|
|
plz I need to know in sql 2005 which data type is case sensitive.
BiG RaLpH
|
|
|
|
|
It depends on the collation that has been set up.
|
|
|
|
|
I have to input data into 2 fields that are primary keys and some of the only difference between the data is the case. one is uppercase the other is lower case. I tried the nchar the nvarchar and the char. it works if I use the binary but how can I display these if they r in binary.
BiG RaLpH
|
|
|
|
|
go to Modify for table and set collation for field case sensitive any for language
Rami Abdalhalim
|
|
|
|
|
Thx rami it worked
BiG RaLpH
|
|
|
|
|
Big Ralph wrote: it works if I use the binary but how can I display these if they r in binary.
Where did I say anything about binary?
|
|
|
|
|
You may not have said binary, but we can read between the lines.;P It's what you really meant - admit it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
OK - forum rules. Don't start new threads when you have the same one actively on the go.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm not finding the sql DATA type that is case sensitive Please Help.
BiG RaLpH
|
|
|
|
|
|
Actually I'm not trying to find anything in case sensitive mode all I want is to set the primary key to be case sensitive coz it's been a dbf database Now I'm migrating it from dbf to sql 2005 (mdf). thx for ur reply and plz if you have an answer plz let me know.
BiG RaLpH
|
|
|
|