|
Don't double-post. It's rude.
Anyway, why did you think it was a good idea to post your question in the SQL forum. Your question has nothing to do with SQL. Next time, I suggest you engage your brain and think for 5 seconds before you post.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Do NOT post the same question in multiple forums. Doing so is considered very rude around here and on other sites as well. And, as you've found out, it doesn't get your question answered any faster.
BTW, what does this have to do with SQL??
|
|
|
|
|
Hi people.This is Amitav Guha From Bangladesh.
How can i deploy a SQL database after designing it?
Can anyone plse answer me.
|
|
|
|
|
You could backup the database on your development server and restore it to your production server.
Alternatively, generate scripts for your database from Management Studio, copy and run them on your production server.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I figured this out! I has to do with that the web app is logging in using sql authentication and I wasn't.
I have an issue and I don't really know how to put it in words in order to put it in a search engine and hope to get an answer, so I will tell you my problem and I hope you can help me.
My software accesses a SQl Server database using the connection string
("Data Source=.\SQLEXPRESS;AttachDbFilename=" + txtbxdatabase.Text + ";Integrated Security=True;Connect Timeout=30;User Instance=True") (I go the sintax from the connection string created from wizard)
As you can see it gets the name of the database from a text box. This works perfectly until we try to use our software with a third party vender's software.
Third Party software uses ASP to connect to the Sqlserver on station (PC) and writes transaction data to it. When my program tries to open the same Sqlserver on the station (PC) it gets an error (I did not write it down) that, in so many words, would not let my program access the database because it is already in use. I think my connection string is the problem, but I have not found anything helpful online.
Any ideas?
modified on Tuesday, February 12, 2008 8:53 AM
|
|
|
|
|
n my C# program, I get the following error when trying to write to a
table:
"Dynamic SQL generation for the UpdateCommand is not supported against
a SelectCommand that does not return any key column information."
i use this code :
da = new OracleDataAdapter(command, con);
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
comB = new OracleCommandBuilder(da);
da.Fill(ds, "product");
ds.Tables["product"].PrimaryKey = new System.Data.DataColumn[] { ds.Tables["product"].Columns["item_code"] };
comB.GetUpdateCommand();
da.Update(ds, "product");
Sujit
|
|
|
|
|
Hi Sujit!
Do you have a primary column defined in the Table? If not then defined it.
You must have a primary key defined in your database tables to avoid this error.
I hope this will help you.
Regards.
|
|
|
|
|
Hi friend
Basically i have have a product table which have one primary key item_id. i use this statement for fetching data in dataset ( select itemcode,.......... from table) then i make a primary key in dataset on itamcode.after updating all data in dataset. i use da.update(ds) then it generate error. Where i am wrong please suggest me thanks
Sujit
|
|
|
|
|
hi all
can u plz help me...
here iam writing the query to get top 10 records from tbl_person table.
i.e select Top 10 * from tbl_person
here it is diplaying top 10 ..that is ok
but i want to display the last 10 records(last entered)...
is there any possibilities....
thankyou.
siri
|
|
|
|
|
Apply a sort so that the last entered records are output first.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi,
can u plz help me to that...
i have very poor knowledge in dat.
thank u...
siri
|
|
|
|
|
sirisha guttikonda wrote: can u plz help me to that...
i have very poor knowledge in dat.
I'm not going to write your code for you. However I suggest you add an ORDER BY clause to your query to sort the records in the right order. Then select the records you want.
If you have poor knowledge of SQL, I suggest you purchase a SQL book.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi Sirisha!
sirisha guttikonda wrote: but i want to display the last 10 records(last entered)...
Is there any Datetime column in Table,which store the record with it's created time? If yes then you can easily retrieve the desired output.
select top(10) * from tbl_person order by Date_Created desc
Even If you have autogenerate column in table then also you can find record from above query,just replace Date_Created with the autogenerate column.
I hope this will help you.
Regards.
|
|
|
|
|
Hi siri,
U can write the query like
Select top 10 * from tbl_person order by (Keycolumn) desc.
Does this help?
Sabarinathan T, Chennai, India.
The interests are to know something about everything and everything about something...
|
|
|
|
|
|
I need help with the syntax below to subtract two years from the current date
select oe_hdr.customer_id
from oe_hdr
where year (oe_hdr.order_date) >= year (getdate()-2 )
Thank You
|
|
|
|
|
YEAR(DATEADD(yy, -2, GETDATE()))
|
|
|
|
|
Use the datediff function.
|
|
|
|
|
I need to write a script that gets the first time an employee attended a live class, the script I wrote below works but I need to also display the name of the class, but the result set goes out of whack when I include the className field to the select statement. Can someone please tell me how I can display the class name in my result set. The className field is in tblClass. Thanks
SELECT tblAttendance.EmployeeID, vwEmployeeInformation.FullName, MIN(tblAttendance.AttendanceDate) AS FirstAttendanceDate
FROM tblAttendance
INNER JOIN tblClassInstance ON tblAttendance.ClassInstanceID = tblClassInstance.ClassInstanceID
INNER JOIN tblClass ON tblClassInstance.ClassID = tblClass.ClassID
INNER JOIN vwEmployeeInformation ON tblAttendance.EmployeeID = vwEmployeeInformation.EmployeeID
WHERE (tblClass.ClassFormat = 'On Demand') AND (tblAttendance.AttendanceDate BETWEEN '08/10/07' AND GetDate())
GROUP BY tblAttendance.EmployeeID, vwEmployeeInformation.FullName
modified on Friday, February 8, 2008 10:01 AM
|
|
|
|
|
It should go out-of-whack when you add class name since you would then be asking the server to give you the first attendance date of EACH class each student took. I have to assume that a student can take multiple classes in a day and that AttendanceDate does not respect the time of the class (only the date).
Here is a messy start that should work on SQL Server. I used your original query to aquire the necessary root data for finding the first class name. TOP 1 is used in case the student attends more than 1 class that day and time is not embedded in AttendanceDate.
SELECT
EmployeeID,
FullName,
FirstAttendanceDate,
(SELECT TOP 1
tblClass.className
FROM
tblAttendance
INNER JOIN
tblClassInstance
ON (tblAttendance.ClassInstanceID = tblClassInstance.ClassInstanceID)
INNER JOIN
tblClass
ON (tblClassInstance.ClassID = tblClass.ClassID)
WHERE
tblAttendance.EmployeeID = root.EmployeeId,
tblAttendance.AttendanceDate = root.FirstAttendanceDate) AS ClassName
FROM
(SELECT
tblAttendance.EmployeeID,
vwEmployeeInformation.FullName,
MIN(tblAttendance.AttendanceDate) AS FirstAttendanceDate
FROM
tblAttendance
INNER JOIN
tblClassInstance
ON (tblAttendance.ClassInstanceID = tblClassInstance.ClassInstanceID)
INNER JOIN
tblClass
ON (tblClassInstance.ClassID = tblClass.ClassID)
INNER JOIN
vwEmployeeInformation
ON (tblAttendance.EmployeeID = vwEmployeeInformation.EmployeeID)
WHERE
(tblClass.ClassFormat = 'On Demand') AND
(tblAttendance.AttendanceDate BETWEEN '08/10/07' AND GetDate())
GROUP BY
tblAttendance.EmployeeID,
vwEmployeeInformation.FullName) AS Root
|
|
|
|
|
Thanks a lot Michael, just what I needed... I've learnt something new..
|
|
|
|
|
how we can export table into text .csv files using sqlserver enterprise manager
|
|
|
|
|
Google not working for you? There are many results [^] available
|
|
|
|
|
if it i can find in google . iam not asking you .if you know just give me idea otherwise silent. in google i get solution use ems. but with out using ems i am asking
|
|
|
|
|