I have high precision dates stored in an SQL server, e.g.
2009-09-15 19:43:43.910
However when I convert that value into a DateTime the miliseconds value of the resulting DateTime value is 0:
reader["Timestamp"] = 15/09/2009 19:43:43.000
Having these DateTime values in precision down to milliseconds is very important to me - what i...
I have a table with one field: lngStatusID with value 2 for all the records.
Now I need to insert all the records again in the same table but with lngStatusID=1
So for that I think stored procedure will help me somehow.
AS per my logic it should be something like:
1) I need to read each record with loop
2) copy all fields in tempora...
Hi,
I have some difficulties when it comes to multi-table query in Linq to Sql.
I have 3 tables:
Product
Row (with Fk-ProductId)
Price (with Fk-RowId)
I'd like to retrieve the min(Price) for a product. I was able to get the right Sql query, but now I need to 'translate' this query into Linq To Sql.
Can you please help me ?
Here the...
I have a bunch of tables like this:
Lookup_HealthCheckupRisks
------------
ID Name
1 Anemia
2 Anorexic
3 Bulemic
4 Depression
...
122 Syphilis
PatientRisksOnCheckup
------------------
ID CheckupID RiskID
1 11 2
2 11 3
3 12 1
4 14 1
5 14 3
...
But I need a flattened version, like th...
What’s the quickest way to export SQL Server data to CSV with ALL column fields enclosed in double quotes, including numeric fields?
In the Results window of Management Studio, I can right click and choose “Save Results to CSV” but it doesn’t enclose fields in double quotes.
I have looked into similar questions but the solutions propo...
I have a Stored Procedure that loops through the months in the fiscal year and does a count for the items in each month. I know for a fact there are 176 items, but when I run this it returns a total count of 182. I tried removing one second from @EndDate, but then my total count was 165. So I'm either counting items twice, or not coun...
Our SQL Server 2000 instance hosts several databases which are all similar, one for each of our client. When comes the time to update them all, we use Red Gate SQL Compare to generate a migration script between the development database and a copy of the current state DB of all the clients database.
SQL Compare generates a script which i...
Hello everyone,
I want to know where to see SQL Server start/stop logs for each instances and SQL Server agent/job start/stop logs? I am developing some tools to monitor SQL Server status. I am using SQL Server 2008 Enterprise.
thanks in advance,
George
...
Hello everyone,
I am using SQL Server 2008 Enterprise for development. I find from SQL Server logs, there are items like,
2009-09-20 19:54:33.55 spid53 Starting up database 'DummyOrderDB'.
My confusion is, I think we could only start/stop database server instance (the contained database will be started/stopped when the containin...
am writing stored procedure in mysql 5.1 and call from c#.net ..and i want use that procedure in sql server..if its possible..please explain..
...
Hi,
I manage a server with around 400+ databases which have the same database schema, i wish to deploy a custom clr/.net user defined function to them all, is there any easy way to do this, or must it be done individually to each database?
Best Regards,
Wayne
...
I'm currently using Microsoft Sync Framework and everything is working fine except the SQL triggers which don't appear to fire sometimes. Here is the trigger code generated by the framework. It works 90% of the time but occasionally the CreationDate is NULL after an insert. Could there be some date issue that I'm overlooking?
set ANS...
Hi
I have used SMO API.in that i have used SmoApplication.EnumAvailableServers(FALSE) and from that i have filtered local instances i have used this approch insted of true to make this as convinent for remote sqldiscovery also.using that api created a dll and use that dll in c++.
Now this is working in all combinations but some times i...
This might be a bit of a naive question and probably something I should know by now but here goes..
I restored a 35Gb database on my dev machine yesterday and it was all going fine until this morning when my client app couldn't connect. So I opened SQL Management Studio to find the database 'In Recovery'.
I don't know a huge amount a...
I have created database in SQL Server 2008 Compact Edition and now I want to migrate that database in SQL Server 2008 Express Edition.
How can I achieve this? Please suggest me the necessary steps. As now, this is my project requirement.
...
I am trying to restore a database from a backup file on a SQL Server 2008 instance using the following SQL command:
BEGIN
RESTORE DATABASE [MyDataBase]
FROM DISK=@db_location
WITH STATS=5,
FILE=1,
MOVE @db_OldName TO @db_NewFile,
MOVE @db_OldLogName TO @db_NewLogFile,
NOREWIND, NOUNLOAD, RESTART, RECOV...
hi guys,
I need a query in sql to get total columns in a table.Can anybody help?
...
We have a test that runs within a transaction scope. We dispose of the transaction scope at the end to avoid changing the database.
This works fine in most cases.
However, when we use Entity Framework to execute a stored procedure which contains a transaction, which is committed inside the stored procedure. We get the following error:
...
Hi,
I have 2 tables one with a lot of records(table 1), and a second(table 2) with similar data but with far fewer records.
On a regular basis i need to add a marker to records in the larger table where there is a corresponding record in the smaller table. For example this could be an email address.
So if email address exists in the s...
Nothing I have tried so far has worked...
...