sql-server-2008

Using Kerberos authentication for SQL Server 2008

I am trying to configure my SQL Server to use Kerberos authentication. My setup is like this - My setup is like this- I have 2 virtual PCs in a Windows XP Pro SP3 host. Both VPCs are Windows Server 2003 R2. One VPC acts as the DC, DNS Server, DHCP server, has Active Directory installed and the SQL Server default instance is also runni...

SQL 2008 Select Top 1000 and update the selected database drop-down

When you right click and do a Select top 1000 rows from a table in sql 2008, it opens a tab and writes the sql and then executes it. This is okay, however I'll erase the sql and use the same tab often to do other sql statements. What annoys me is that I have to go to the database drop-down at the top of the window and change it to the cu...

Should we use Visual Studio 2010 for all SQL Server Database Development?

Our company currently has seven dedicated SQL Server 2008 servers each running an average of 10 databases. All databases have many stored procedures and UDFs that commonly reference other databases both on the same server and also across linked servers. We currently use SSMS for all database related administration and development but ...

Advice needed: cold backup for SQL Server 2008 Express?

What are my options for achieving a cold backup server for SQL Server Express instance running a single database? I have an SQL Server 2008 Express instance in production that currently represents a single point of failure for my application. I have a second physical box sitting at the installation that is currently doing nothing. I w...

How to give over right (table) permission in SQL Server 2008?

I am using SQL Server 2008. I tried to modify the table. But it not allowing to update. How to give UPDATE permission in SQL Server 2008? ...

Execute SPROC after completion of another SPROC

Essentially, I want to do this in T-SQL 1) Execute SPROC1 2) Upon completion of SPROC1, execute SPROC2 3) Upon completion of SPROC2, execute SPROC3 I know this is possible using SSIS. If there any way I can do this? Thanks ...

Queue access to the database to avoid multiple cache items

I have a music related ASP.NET web site which caches a lot of static information from the database on the first request. Sometimes, the application is reset and cache is cleared while the application is on heavy load and then all http requests go to the database to retrieve that static data and cache it for other requests. How can I en...

Is that possible to get the key Relationship avilable in my DataBase using query in sql server?. how?.

I have many table in my database it contain many key relation. i need to list out the table and its corresponding key name and the relationship table. ...

Correct way to generate order numbers in SQL Server

This question certainly applies to a much broader scope, but here it is. I have a basic ecommerce app, where users can, naturally enough, place orders. Said orders need to have a unique number, which I'm trying to generate right now. Each order is Vendor-specific. Basically, I have an OrderNumberInfo (VendorID, OrderNumber) table. Now ...

Error invoking stored procedure with input parameter from ADO.Net

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + ADO.Net. Here is my code and related error message. The error message says, @Param1 is not supplied, but actually it is supplied in my code. Any ideas what is wrong? System.Data.SqlClient.SqlException: Procedure or function 'Pr_Foo' expects parameter '@Param1', which was not...

Performance impact when using XML columns in a table with MS SQL 2008

I am using a simple table with 6 columns, 3 of which are of XML type, not schema-constrained. When the table reaches a size around 120,000 or 150,000 rows, I see a dramatic performance cost in doing any query in the table. For comparison, I have another table, which grows in size at about the same rate, but only contain scalar types (int...

Can I select a set of rows from a table and directly insert that into a table or the same table in SQL?

Hi all I was just curious if I could do something like - insert into Employee ( Select * from Employee where EmployeeId=1) I just felt the need to do this a lot of times...so just was curious if there was any way to achieve it.. ...

How to save byte[] to varbinary(64) field in database

I have byte[] a = HashEncrypt("a"); with public byte[] HashEncrypt(string password) { SHA512Managed sha = new SHA512Managed(); byte[] hash = sha.ComputeHash(UnicodeEncoding.Unicode.GetBytes(password)); return hash; } I want to save byte[] a to my database. My database field is a varbinary(64). I'm using SQL Server 2008....

TSQL Shred XML - Is this right or is there a better way (newbie @ shredding XML)

Ok, I'm a C# ASP.NET dev following orders: The orders are to take a given dataset, shred the XML and return columns. I've argued that it's easier to do the shredding on the ASP.NET side where we already have access to things like deserializers, etc, and the entire complex of known types, but no, the boss says "shred it on the server, ret...

TSQL Shred XML - Working with namespaces [ANSWERED]

Here's a link to my previous question on this same block of code with a working shred example Ok, I'm a C# ASP.NET dev following orders: The orders are to take a given dataset, shred the XML and return columns. I've argued that it's easier to do the shredding on the ASP.NET side where we already have access to things like deserializers,...

SQL Server 2008 Time column messing up GridView DataFormatString

I've got a nullable column in SQL Server 2008 that I use to store a time. When I use LINQ to SQL and pull data back it comes back as TimeSpan?. When I bind that to a GridView and try to format it using DataFormatString="{0:t}" it still shows the seconds. Any thoughts? ...

Selecting data in clustered index order without ORDER BY

I know there is no guarantee without an ORDER BY clause, but are there any techniques to tune SQL Server tables so they're more likely to return rows in clustered index order, without having to specify ORDER BY every single time I want to run a super-quick ad hoc query? For example, would rebuilding my clustered index or updating statis...

Creating a stored procedure in SQL Server 2008 that will do a "facebook search"

Hello, I'm trying to implement a facebook search in my system (auto suggest while typing). I've managed to code all the ajax stuff, but I'm not sure how to query the database. I've created a table called People which contains the fields: ID, FirstName, LastName, MiddleName, Email. I've also created a FTS-index on all those fields. I w...

blank to numeric conversion derived column

Hi All, I have a source column with blank (not "NULL"), and target as numeric. while converting using the data conversion it is not converting due to balnk source value so I used derived column to replace a blank value with NULL or 0 as (source column == " ") ? "0" : source column but its not giving the value as 0 in the blank place. ...

Changing Database Name In Stored Procedures

Hi, I need to change the database name in SQL SERVER 2008 and use it in another project. However it consist hundreds of stored procedures and the name of the database should be changed in the stored procedures as well. Is there any way to do this? ...