Skip to content
Advertisement

Tag: sql-server

Convert SQL Server DateTime object to BIGINT (.Net ticks)

I need to convert a DateTime type value to BIGINT type in .Net ticks format (number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001). The conversion should be perform in Sql server 2008 using T-SQL query For example: will convert to: Answer I have found a CodeProject article that may assist: Convert DateTime To .NET Ticks

SQL query to get the precision value of a column

I need a sql query that gets the precision value for certain columns.. I am mainly concerned with a decimal type column and I need the precision value for the same. I realise that it is possible to do so in certain versions and vendors of database servers. It would be nice if you could list down for a few

Drop a temporary table if it exists

I have two lines of code in SQL that create two tables on the fly, i need to do something like IF TABLE EXISTS DROP IT AND CREATE IT AGAIN ELSE CREATE IT my lines are the following ones …

Group by every N records in T-SQL

I have some performance test results on the database, and what I want to do is to group every 1000 records (previously sorted in ascending order by date) and then aggregate results with AVG. I’m actually looking for a standard SQL solution, however any T-SQL specific results are also appreciated. The query looks like this: Answer Something like that should

Display a ConnectionString dialog

I’m trying to create a program in C# that should be able to create, backup and restore a SQL Server database. For this, the user needs to be able to setup a connection string to the desired SQL Server (and database). I would like to use the same dialog as for example Visual Studio for creating the connection string. Is

Advertisement