sql-server

How do I create tables in VS 2008?

I am running VS 2008 Standard and SQL Server Express. I created the tables in the Database Designer (creating and xsd), and created the database. How do I get the tables from the Database Designer into the database? Also, is there some documentation available? Thanks! ...

Database Naming Conventions by Microsoft?

I found Naming Guidelines from MSDN, but is it any guideline for MSSQL database from Microsoft? ...

SQL Server Questions

How do I rename a database in Server Explorer on Visual Studio 2008? I changed the filename using Rename on the context menu, but that just changed the filename, not the name in SQL Server (2005 Express). Also, is there an easy-to-use management tool like PHP MyAdmin that I can use? Or is it easier to just use VS 2008 Server Explorer? ...

Select / Insert version of an Upsert: is there a design pattern for high concurrency?

I want to do the SELECT / INSERT version of an UPSERT. Below is a template of the existing code: // CREATE TABLE Table (RowID INT NOT NULL IDENTITY(1,1), RowValue VARCHAR(50)) IF NOT EXISTS (SELECT * FROM Table WHERE RowValue = @VALUE) BEGIN INSERT Table VALUES (@Value) SELECT @id = SCOPEIDENTITY() END ELSE SELECT @id = RowID ...

Does SQL Server have any built-in error checking mechanisms with regards to receiving an sql statement?

This question is a follow-up/in relation to my previous question here: http://stackoverflow.com/questions/3518498/sql-server-is-there-a-need-to-verify-a-data-modification I did some googling, and the paper (which I can't access) "When the CRC and TCP checksum disagree" indicates the occurrence of an unchecked error rate of 1 in 16 milli...

should primary key be included in regular indexes

Regarding MS SQL-Server, Is the Primary Key column of a table, included in the regular non-unique indexes on that table? if not, would it make sense to include it in the index? create table dbo.People ( PK_PersonId int not null, PersonName nvarchar (100), Bunch of Other Fields , so when creating an index on PersonName, would it make...

How do you pronounce "Microsoft SQL Server" ?

Possible Duplicate: SQL Pronunciation What is the correct way of pronouncing "SQL" in "Microsoft SQL Server" ? ess-cue-el or sequel I've heard it both ways, but what is the official? ...

Urgent! Need help selecting IDs from a table if 2 conditions in other tables match

Sorry for the worst question title ever but I find it hard to explain in a sentence what im having trouble with. I am developing a user feedback system using ASP.NET and C#. I have multiple tables and am trying to populate dropdown lists so that the feedback can be filtered. My tables: CREATE TABLE tblModules ( Module_ID nvarchar(10) ...

Entity Framework 4: Eager Loading (Include) with filters using Self Tracking Entities

I have a solution where I have created self tracking entities using the RTM templates. I have split the entities and context between 2 projects so that I can reuse the type definitions as I plan to run client/server via WCF. One of my service methods is required to return a graph of "Product" objects with child objects of "ProductSku" a...

Trying to filter datagrid according to selections made in dropdown lists

I have a View Feedback page with two drop down lists to filter the gridview of answers to questions. The 1st ddList is Modules, once this is selected, the 2nd ddList of Questions becomes enabled and the user can select a question to see the answers for it in relation to the module selected, OR they can select to see all answers to all qu...

Check constraints in Ms Sql Sever 2005

Hi , I am trying to add a check constraint which verity if after an update the new value (which was inserted) is greater than old values which is already stored in table. For example i have a "price" column which already stores value 100, if the update comes with 101 the is ok, if 99 comes then my constraint should reject the update p...

converting clustered index into non-clustered index?

Is it possible to convert a clustered index to non clustered index or non clustered index to clustered index in sql server 2005. Please convert this query into clustered index: create index index1 on mytable(firstcolumn) Please convert this query into non clustered index: create clustered index clusindex1 on mytable(cluscolumn) ...

Setup Program for Windows Service C# How to add Sql Database's

I've written on visual studio 2010 a windows service. I create all database on vs2010, where I've created a setup program for windows service to install it. My problem is I can not put my database to setup program, so that my windows service gives error on sql-database's. (At debug mode there are no problems, win. service works fine) H...

Why is my CASE expression non-deterministic?

I am trying to create a persisted computed column using CASE expression: ALTER TABLE dbo.Calendar ADD PreviousDate AS case WHEN [Date]>'20100101' THEN [Date] ELSE NULL END PERSISTED MSDN clearly says that CASE is deterministic, here However, I am getting an error: Msg 4936, Level 16, State 1, Line 1 Computed column 'Previo...

Using custom cmdlet from SQL Server

I want to execute a Powershell script from SQL Server's maintenance plan. This is fine and perfectly possible, but what if I want to use a custom cmdlet? Can this still work from the Powershell script SQL Server job step (in this case, I need to use the SCVMM cmdlet). ...

TableName using stored procedure in SQL

I have some problems to passing the @TableName inside a Nearby procedure to use in one StoreLocator. I need to get in 3 tables. I have tested using QUOTENAME but the problem is always here. Can someone help me to fix this problem. Thanks ALTER PROCEDURE [dbo].[GetNearbyTable] @Table sysname, @CenterLatitude FLOAT, @Cente...

Executing two INSERT an the same stored procedure with a SCOPE_IDENTITY

Hi ! I would like to insert a record into my SQL Server database with a stored procedure and catch the ID of this inserted row (SCOPE_IDENTITY()) to use it in another insert command. Because I would like to execute those two select command the one after the other if the one didn't pass the other didn't pass too ! Any Idea ? Thank you...

How to intert image in SQLServer uing sql query without using parameters.

I am trying to insert image in my databse .However I dont want to use the parameters as my set up of coding pattern does not allow this.Is there a way out? I know that following code inserts the image byte[] imageData = ReadFile(txtImagePath.Text); SqlConnection CN = new SqlConnection(txtConnectionString.Text); string qry = "i...

How to export xml to database - asp.net

I want to export xml file data to sql database table. Can anyone guide me for this? ...

Stored Procedure

-I want to transfer data in a temporary table to EIM tables , for that i have to write a stored procedure ...