|
I've just spent time documenting a new database model in Visio 2003 professional.
I'm now at a stage that I need to build the DDL.
I've just discovered that my version of Visio 2003 does not build DDLs !
Is there any kind soul out there who would be prepared to take my visio diagram and return to me the SQL Server DDL ?
my email address is g a r y . r a n s o n @ c l a r a . n e t
|
|
|
|
|
I writing an N-tier application, where I will used strongly typed DataSets as data transport objects between some tiers.
The application consumes a web service. By default VS has created a proxy and a number of classes that are used to hold the data the web service returns, ie classes that mirrors the result xml structure. I want to move to DataSets instead.
Is there a clever way to make a web service proxy automatically fill a typed DataSet instead of the auto-created classes when I call the web service? Observe that this web service does not return a DataSet per se (this would be simple then), but a structure that would easily be held within a DataSet.
Manually I can look inside the wsdl, extract the schemas, let VS create typed DataSets from those schemas, write code that consumes the web service through the proxy, move over all retrieved data to my DataSets, done. Since this seems like a common scenario, I'm just hoping that VS has an automated way of doing this. What would be the easiest way?
Kind regards,
/Björn Morén
Sweden
|
|
|
|
|
Here's what I want to do: I have an application that delivers web based security forms for individuals to fill out. I am trying to write a GUI that will allow someone with little coding experience create a form.
I want to offer the option of copying an existing form (including the actual ASP page and SQL table). I can handle duplicating and renaming the actual ASP form, but I can find no information on how to copy a tables columns, data types, constraints and triggers from an existing table to a new one, renaming the new table to correlate to the new form. I hope someone can help me. Thanks!
|
|
|
|
|
Probaly the most straight forward method would be to create a DTS package, then call that from code - can supply an example if necessary, but not to bad to just "have a go at"...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I would agree with Richard in using the DTS package if the requirement are to copy the triggers, indices & constraints as well.
For a just a table the easiest way would be to
Select *
Into [tblNewTable]
From [tblExistingTable]
Where 0=1
Michael
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)
|
|
|
|
|
Dear Friends,
I got two tables: order and orderDetails
Order table is:
OrderId CustomerCode OrderDate
1 55 2/12/2004
2 55 3/12/2004
3 56 4/15/2004
4 57 4/16/2004
OrderDetail table is:
OrderId ProductId Quantity
1 131 12 Litres
1 157 13 KGs
1 111 12 MT
2 131 19 litres
3 155 12 dozens
I want SQL query such that:
I want to print all the productId placed by customerCode 55 and orderdate
i.e result contains following columns:
CustomerCode, OrderDate, ProductId, Quantity
For customer code 55. What can be the query ??
|
|
|
|
|
does this sql statement help u in any way :
Select CustomerCode, OrderDate, ProductId, Quantity From [Order] a Inner Join OrderDetails b On a.OrderID = b.OrderID
Where a.CustomerCode = 55
Try not using Keywords for Table/Column names (like Order).
Parshu
|
|
|
|
|
parshu21 wrote:
Try not using Keywords for Table/Column names (like Order).
That's good advice - It can get confusing.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event[^].
|
|
|
|
|
Hi,
I am having trouble adding new rows to an empty MS Access table.
I manually created the table in MS access named server and created two
columns Date & Time.
When I run the following code I get: "Syntax error in INSERT INTO
statement".
Any help would be great.
Thank you.
OleDbCommand fgSelectCommand = conn.CreateCommand();
fgSelectCommand.CommandText = "SELECT TOP 1 * FROM Server";
OleDbDataAdapter fgADOAdapter = new OleDbDataAdapter();
OleDbCommandBuilder fgCommandBuilder = new
OleDbCommandBuilder(fgADOAdapter);
fgADOAdapter.SelectCommand = fgSelectCommand;
DataTable fgDataTable = new DataTable("Server");
fgADOAdapter.FillSchema(fgDataTable, SchemaType.Source);
DataRow fgDataRow = fgDataTable.NewRow();
fgDataRow["Date"] = logWeb.LogDate;
fgDataRow["Time"] = logWeb.LogTime;
fgDataTable.Rows.Add(fgDataRow);
fgADOAdapter.Update(fgDataTable);
|
|
|
|
|
Try ExecuteScaler with a stored procedure and return a Success or Failure value.
Using a stored procedure would be better but here is some SQL to get you started.
This is obvious with VB.Net.
Dim cmd as New SqlCommand
cmd.Connection = cn 'Connection
cmd.CommandText = "Insert into [Server] ([Date], [Time]) Values (yourDate, yourTime)"
cmd.commandType = CommandText
return cmd.ExecuteNonQuery
Hope this helps,
Michael
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)
|
|
|
|
|
Michael,
Thank you for the advice.
Cheers,
Craig
|
|
|
|
|
hi,
the message in debug show "Run-Time Check Failure #2 - Stack around the variable 'ls_BureauID' was corrupted!"
what's the meaning?
thanks!
|
|
|
|
|
Is this field ref'd by a constraint ?
This could be part of the issue.
Tony
|
|
|
|
|
the field is defined as char ls_BureauID[4],now this problem has been resolved by enlarging it's length,but i want to know some more run time knowledge,for when and why this prompt come out?
thanks!
|
|
|
|
|
Sounds more like a C++ issue than a SQL, ADO or ADO.NET issue, unless SQL Server itself is giving this error. Your C++ code is probably overrunning a stack-based buffer.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hello,
I have a question about querying an Access database from a .Net program. I am using C#.
What I want to be able to do is use the instrrev() function in an sql query to find the first period from the right of a string (to get the extension from and e-mail address). However, anytime i try to use instrrev I get an error saying that instrrev is an unknown function. I don't get this error when I use instr(). I researched on the internet and decided that this must be caused by the sandbox mode in the jet engine, so I turned sandbox mode off in Access. However, I still the get the same error when running the query from my C# program. Does anyone know how I can use this function, or is there any other way to solve my problem? I thought about using strreverse() and the using instr(), but it turns out that strreverse() is another function that won't work.
Any help is appreciated. Thanks!
Blake
|
|
|
|
|
Well if all else fails you could just write your own function to find the first instance of a period from the end of the string. This isn't C#, but should give you an idea.
int FindCharRev (const CString str, const char c, CString& buf)
{
char* pStr;
int index, j = 0, len = str.GetLength ();
for (int i = len; i > 0; i--) {
if (str[i] == c)
{ index = i; break; }
}
pStr = (LPTSTR)(LPCTSTR)str;
pStr += index;
while (pStr) {
buf[j] = *pStr;
pStr++;
j++;
}
return index
} That's a crude implementation, but it should put the string after the first instance (from the end of the string) of a character in the "buf" parameter and return the index of where that character was found.
- Aaron
|
|
|
|
|
It sounds like you're trying to get your database to do too much work. If this is in the presentation part of the SELECT, not in any selection clauses (WHERE, HAVING, ON), do it in the C# code once you've got the results.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
My Oracle docs on INSTR say that you pass a negative value for the third parameter, and the search will be done from the end of the string.
select instr('CORPORATE FLOOR,'OR',-3,2) from dual
will a return a value of 2
Not sure if this is the same in access, though.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
Anybody worked on this new Reporting Services[^] from Microsoft?
I appreciate your input.
Promise only what you can do. And then deliver more than what you promised. This signature was created by "Code Project Quoter".
|
|
|
|
|
Hi everyone
I'm working a program that needs to interface with a dBase 3 and pull records (sometimes limited amount) based on a zip code field.
Also i need to pull the oldest records first by using MAILED field.
I came up with this query to pull the data:
SELECT TOP 5 * INTO DESTINATON.dbf FROM SOURCE.dbf WHERE ZIP5 = '95003' ORDER BY MAILED ASC
This query works. It select top 5 record, creates DESTINATON.dbf witch is identical in structure to SOURCE.dbf and populates it with selected records.
The hard part is to update the MAILED field in the same query, so next time I don't use the same records.
There in no unique field that i can use to match pulled records to the SOURCE.dbf and update it.
I want to do it all in one shot, but I'm not sure that this is possible.
I'm using ADO 2.7
Any help is greatly appreciated.
Thank you
Ilya
|
|
|
|
|
Try this with your appropriate primary key field name substitution. Not sure about your dbf suffix as it's been about 8 years since I touched dbase.
SELECT TOP 5 SOURCE.*
INTO DESTINATON
FROM SOURCE
LEFT JOIN DESTINATON
on DESTINATON.PRIMARYKEY = SOURCE.PRIMARYKEY
WHERE SOURCE.ZIP5 = '95003'
AND DESTINATON.PRIMARYKEY IS NULL
ORDER BY SOURCE.MAILED ASC
Janya
|
|
|
|
|
Hello people,
I just wanted to know if there's anyone out there who can help me or have done this sort of thing before. I'm using remote data access (i know i could've used data adapters, but i just thought it would be interesting to test out RDA capabilities using .NET Framework). I've managed to create a connection, pulled the data, modify it, and then pushed it back onto the SQL Server 200 from my PDA Sql Server CE. The thing is, the column values pulled from the SQL server is different from my Sql Server CE when i view it in my PDA emulator. The two columns appear after my primary key column, with the column values to be:
s_Binary Key (Column 2) and s_Operation (Column 3)
Is it because of the RDA Tracker? Or is it something in built to SQL Ce? And if there any way i can utilise these columns (if they have any benefits at all)? Please help, cos i can't afford anger management classes anymore...
|
|
|
|
|
the problem of @@TRANCOUNT--how to eliminate the no.266 error
|
|
|
|
|
Ensure that every use of BEGIN TRAN is matched with either a ROLLBACK TRAN or a COMMIT TRAN , regardless of whether an error occurs. In the case of a fatal error, SQL Server will roll back any transactions before it closes your connection.
If you have implicit transactions enabled (through SET IMPLICIT_TRANSACTIONS ON ) a BEGIN TRAN happens automatically the first time you perform any data modification operation. You still have to commit or roll-back this implicit transaction explicitly.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|