|
Thanks For help
but I want to know what does (Precision & Scale)means and how can i use them to meet my requirements.
Dad
|
|
|
|
|
for example to have a number with 3 digits on int portion and 2 of decimal
i.e. precision - 5 and scale - 2
means total digits are 5 (precision) out of that 2 are decimal places (scale)
|
|
|
|
|
Great Thanks
But what is the diffrance between decimal and float data type
and how can I store a value like this(123/34)in my database.
Dad
|
|
|
|
|
Numeric data types with
fixed precision and scale are
decimal[(p[, s])]
numeric[(p[, s])]
floating point data
float(n)
for a detailed explanation regarding decimal, numeric, float & real you can refer to online help on "Data Types"
commin for storing the value (123/34) is that you want to store result of this expression, then you can use either decimal/numeric data type with specific number of decimal places or float data type.
|
|
|
|
|
I need to know the steps to connect to the Access database from my C#.Net code written using VS 2005.
|
|
|
|
|
Sanjeewani wrote: I need to know the steps to connect to the Access database from my C#.Net code written using VS 2005.
I typed "C# Connection Access Database" into a search engine and this[^] was on the first page of hits.
|
|
|
|
|
Hello Frnds,
I'm making a Store procedure in which i'm passing a parameter of string type have hotelid like this('1,3'). i want to compare these hotelid from hotel table which have hotelid in int in different records.
like this
-----------------------
hotelid Hotelme
1 Xyz
2 ABC
3 KHL
4 PQR
5 RST
I have hotelid like this (3,5).
I want to get the Hotel Name by store procedure. how can i compare hotelid from string to int while i have hotel id in hotel table is of type INT.
please give me some suggestion.
thanx and regards
Dotnet
|
|
|
|
|
for converting string to int, in SQL Server there are two function.
CAST(<value> AS <datatype>)
CONVERT(<datatype>, <value>)
in your case you can use ...
cast(hotelid AS int)
or
convert(int, hotelid)
|
|
|
|
|
Hello, I'm new to attributes. Attributes seem to solve a problem I have with my data representation. However, how are attributes stored in a database?
Specifically, I'm using VS'03 to build a typed data schema, wherein I create and populate some elements. I can use the SqlDataAdapter to load/retrieve from the dB, no problem. Now, I add attributes to the schema, how do I get them into the dB and what is the representation?
Thanks.
NYC Traveler
|
|
|
|
|
I'm trying to use the SqlDataAdapter to map 2 of 5 columns into a DataTable object and then update changes made to the local table back to the table in the database. Every time the Update command is called, I get DBConcurrency errors. I know this is not because of an actual concurrency issue because I am the only one accessing this database and I've tried this code in a separate program to isolate it from anything else I might be doing. I've read in a few places that this can be caused by an invalid update string, but I can't figure out what's wrong with mine. The code I'm using is below.
string sc = "";
string uc = "";
// The following chooses the proper select and update
// commands based on the value of MethodNumber. This
// is where I choose the column in the original table
// that I want to work with and call it OrderPoint in
// the local table. SSID is the PK.
if(MethodNumber == 1)
{
sc += "Select SSID, Method1OrderPoint As OrderPoint From OrderPoints";
uc += "Update OrderPoints Set Method1OrderPoint = @OP Where SSID = @SSID";
}
else
{
sc += "Select SSID, Method2OrderPoint As OrderPoint From OrderPoints";
uc += "Update OrderPoints Set Method2OrderPoint = @OP Where SSID = @SSID";
}
// Create a new DataTable and SqlDataAdapter, fairly standard
DataTable TableOp = new DataTable("TableOp");
SqlDataAdapter AdapterOp = new SqlDataAdapter(sc, Connection);
// Add parameters to the Update command. I've checked the
// SqlRowUpdatingEventHandler and these are being passed properly
// at run time
SqlCommand UpdateCommand = new SqlCommand(uc, Connection);
UpdateCommand.Parameters.Add("@SSID", SqlDbType.NChar, 14, "SSID");
UpdateCommand.Parameters.Add("@OP", SqlDbType.Int, 1, "OrderPoint");
AdapterOp.UpdateCommand = UpdateCommand;
// Add the custom table/column mappings. I've tried every conceivable
// permutation for every possible value I can think of to put in these,
// but no luck so far.
DataTableMapping MappingOp = AdapterOp.TableMappings.Add("OrderPoints", "TableOp");
MappingOp.ColumnMappings.Add("SSID", "SSID");
MappingOp.ColumnMappings.Add("Method1OrderPoint", "OrderPoint");
MappingOp.ColumnMappings.Add("Method2OrderPoint", "OrderPoint");
// Fill the schema and the table. These work fine. The TableOp
// looks and behaves exactly as I would expect.
AdapterOp.FillSchema(TableOp, SchemaType.Mapped);
AdapterOp.Fill(TableOp);
// Change TableOp.
foreach(DataRow CurrentRow in TableOp.Rows)
{
CurrentRow["OrderPoint"] = 1;
}
// Here's the update command.
AdapterOp.Update(TableOp);
This throws the following exception:
System.Data.DBConcurrencyException: Concurrency violation: the UpdateCommand affected 0 records.
I've also tried using a DataSet object instead of the single DataTable with no luck.
I'm using Sql Server Express 2005 with Visual Studio 2003. I've also tried using their visual interface for building an SqlDataAdapter and it fails to generate update and delete commands for a mapped table.
Is it even possible to do this, and if not, what exactly is the point of table/column mapping?
Thanks
-Matt
|
|
|
|
|
My delete trigger will rollback the operation under certain conditions, however even when it does, the statement still returns a count > 0 of records affected (using SQLRowCount). Anybody know of a way to find out the real number of records affected?
|
|
|
|
|
Suppose I have 3 or 4 triggers on a table for UPDATE. Is there a way to control the execution order of them?
|
|
|
|
|
Not really, not on one table. I assume that you are talking about the same type of trigger here. If they are different trigger types, e.g. DELETE and INSERT, then they are fired based on the operation performed on the table.
Why would you want to have multiple triggers fired anyway? I'm not sure I can see what benefit you would get out of this design.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Because, ON UPDATE i need to do several different things on the table.
some are logging things.
some are denormalization for performance.
some are maintenance issues...
but I need then in certain order.
I know, i stick them all in one trigger... But still, I was wondering if it could be done in 3 triggers
|
|
|
|
|
Does anyone know if there is a list of all the sp_ (built in)procedure and their purpose?
Thanks,
Ankur Bakliwal
|
|
|
|
|
Have a look at Books Online. They list all of the procedures, along with descriptions of what they do.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
check this site
http://www.mssqlcity.com/Articles/Undoc/SQL2000UndocSP.htm
may help you
|
|
|
|
|
Hi all,,
i got some problem ,, there is not data in my dabase but its properties shows the size of the data base about to 2gb,, why is that , i have trunated the data base and there is not data in the data base , i am so tense ,, what to do can any body help me out please ?
hello
|
|
|
|
|
If ur database is SQL Server 2000,
Shrink db then take Backup of Transaction log
this will empty log db and bring down the space occupied
KP
|
|
|
|
|
Is there any site that provides free space to make and use sql database online
?
Thanks
|
|
|
|
|
BACKUP DATABASE [db] TO DISK = N'D:\Classes' WITH NOFORMAT, INIT, NAME = N'db-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
i use this query to backup my db with sql express 2005.
it's fine.but when i use direct partition(eg. C:\) or desktop it's giving error as os error and access denied
anyone can help me
|
|
|
|
|
Probably because the account that SQL Server is running in does not have access to those drives. (NOTE: This is the account the SQL Server process is using, not the account you use to log in to SQL Server)
|
|
|
|
|
thanks
if i try to backup to "c:\" it's giving that error .but if i backup to "c:\new folder" it's ok.i dont know why's that and what'll i do.i think that's not sql account problem.
|
|
|
|
|
I'm curios what's the best option to clear a database that contains a large number of tables?
Do we need to pick every table and issue delete statements (except those that have cascade rule set)?
Does anybody had any similar issue?
company, work and everything else @ netis
|
|
|
|
|
Another way is simply to extract the schema and create a new database from it.
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|