sql-server

advice how to save html table to SQL server

I am trying to save html table to sql server table with unique name and save its data in a database. For example, I have a html table like this(it is dynamically created in browser by user). I use asp.net, C#, Sql Server 2008 express. How can after clicking on save button, create table with unique name, 2 colums int and varchar(40) t...

SQL Query to return 24 hour, hourly count even when no values exist?

I've written a query that groups the number of rows per hour, based on a given date range. SELECT CONVERT(VARCHAR(8),TransactionTime,101) + ' ' + CONVERT(VARCHAR(2),TransactionTime,108) as TDate, COUNT(TransactionID) AS TotalHourlyTransactions FROM MyTransactions WITH (NOLOCK) WHERE TransactionTime BETWEEN CAST(@StartDate A...

SQL Server 2008 - how to zip backup files and move to remote server

Hi, I have the non-enterprise edition of SQL Server 2008. I do nightly backups, manually zip the files and then manually copy to a remote server. I need to automate this using batch files. Copying files from server to server is easy but how do I automate the zipping of the backup first? The full process I need is: Run the backup nig...

Can I concatenate a virtual column in a view?

Unfortunately, I have plaintext passwords in a database. I want to pass these plaintext values around as little as possible for, say, comparisons and updates. To this end, I'm trying to create a view of my Users table that excludes the plaintext passwords and instead provides a hashed value of that password. Here's my current SQL Serv...

How to sort GUID's the SQL Server way using Delphi

In a project I am working on it would be nice if I can sort an in memory list of guids and compare against a SQL server table ordered by these same guids. Unfortunately when an ordered list is returned by SQL Server, the order is not immediately apparent. What would be the best way to sort this in memory list so that the order is the ...

30 million records. Divy them up into 24 hourly-periods. Sum them for one month. Rinse and Repeat.

Hi!, I need to examine 30 million records (one month worth) of daily ticket validations (Unix datetime) and divy them up into 24 one-hour periods for 211 stations. First I created a view which selects the month I’m looking for (and the equipment type) then creates a Windows Datetime value for each Unix datetime. SELECT TOP (100) PERCE...

Finding out the windows group by virtue of which a user is able to access a database in sql server?

There is a SQL Server 2005 database with mixed-mode authentication. Among others, we have the following logins on the server: our-domain\developers-group-1, and our-domain\developers-group-2 which are AD groups. The our-domain\developer-group-2 is added to the sysadmin role on the server, by virture of which all domain users of that ...

What kinds of problems are most likely to occur? (question rewritten)

If I wrote 1) a C# SQL database application (a simple program consisting of a GUI over some forms with logic for interfacing with the SQL database) 2) for home use, that doesn't do any network communication 3) that uses a simple, reliable, and appropriate SQL database 4) whose GUI is properly separated from the logic 5) that has c...

How can I stop SQL Server Management Studio replacing 'SELECT *' with the column list ?

SQL Server Mgmt Studio is driving me crazy. If I create a view and SELECT '*' from a table, it's all OK and I can save the view. Looking at the SQL for the view (eg.by scripting a CREATE) reveals that the 'SELECT *' really is saved to the view's SQL. But as soon as I reopen the view using the GUI (right click > modify), SELECT * is rep...

EnumAvailableServers(false) of SMO in SQL 2008 cluster is returning zero records ??

Call to EnumAvailableServers(false) is reurning zero list of sql instances in the windows 2008 sp2 cluster having sql 2008 sp1 setup. Firewall was disabled.. What are the reasons for its failure?? ...

IsNumeric Time value problem

Table1 Time 10:00:00 12:00:00 Absent 14:00:00 Holiday ..., Time column Datatype is varchar I want to check the time column value is numeric then 'Present' Tried Query Select case when isnumeric(time) then 'Present' else time end as time from table1 Showing error in 'then' How to modify my query according to my requirement Nee...

Data localization in SQL Server with GUIDs or...?

I need to make a database that is highly localized. For almost all entities I need a translation to 5+ languages. Some entities even require and additional resource localized (like images which I enter as paths). The question now is: 1: LOOKUP TABLE PER ENTITY/TABLE (kinda bloated schema?) should I create a "Localized" localization lo...

SQL Server 2000 from ASP.net

Hello, I want detailed step by step for connecting to SQL Server 2000 from ASP.net..... I am trying but getting Connection Open Error.. ...

Set password of an existing sql ce database (per Code)

Hello, I am working with SQL Server and I want to set the Database password of a SQL Server CE Database (*.sdf). I found the Command how I can create a new database with password: CREATE DATABASE "secure.sdf" DATABASEPASSWORD '<enterStrongPasswordHere>' But I want to set a password of an existing db. ...

Why SQL variable still keep previous value ?

I notice a strange thing during doing some stored procedures I can explain that by the following example : DECLARE @FileExtensionID int SELECT * FROM FileExtensions WHERE (Name= 'pdf') SELECT @FileExtensionID = ID FROM FileExtensions WHERE (Name= 'pdf') SELECT IsNULL( @FileExtensionID , 0) -- First Select SELECT * FROM FileExtensions...

order by a parameter

Hi i have a store procedure, where i do a select query. I want order this by an external parameter. I post an minimal example: CREATE PROCEDURE [dbo].[up_missioni_get_data] @order VarChar(100) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- In...

How shall I get more SQL Server and T-SQL Experience...

I'm a developer with over 10 years experience in vb5/6, C#, VB.NET, 3 years of WCF too, design and architecture. I consider myself to be pretty good and can usually solve anything given time (like most good developers). I worked for a company for 8 years and during that time used a database called IBM UniVerse, it's an old Pick style dat...

Why would an Entity Framework model generator not create code for a table when I selected it?

I have Visual Studio 2008: I can create Entity Framework models on existing tables in a SQL Server 2005 database. I can create Entity Framework models on tables I create in a local SQL Server 2008 database files. However, when I add a new table to the SQL Server 2005 database, then try to create an Entity Framework model on it, it le...

SQL Management Studio 2008 - Server name on Query Editor tabs...where did they go???

I recently upgraded to SQL Management Studio 2008 (full not express, if it matters). In 2005, when I was in the Query Editor, each tab (with an unsaved query) would have the servername-instance-query name or something like that, but all I cared about was seeing the server name there so I knew which server I was running my query on. In ...

How can i run a sql query on a schedule without using sql server agent jobs( & no BI too) and pump the results in an excel file

Hi All, I want to run a sql query on a specific schedule (weekly) and need to capture the output in an excel file as well. Due to business restrictions we cannot use SQL server jobs and we cannot install Business Intelligence tools too. Regards, RP ...