sql-server

Whats the difference between an in-memory table, temp table and a pivot table?

With regards to SQL and queries, whats the difference between an in-memory table, temp table and a pivot table? ...

Sql Server modify select

I'm pretty sure there is no way, but i'm putting this out there for those expert beyond my knowledge. What i am looking to do is to somehow alter SELECT statements before they are executed, at the database level. For a seriously pared-down example, i'd like to do something like the following... when someone executes the following SQL ...

help with FOR XML PATH('') escaping "special" characters

this code basically translates characters based on position in one string to the character at the same position in another string and it runs for all rows in the table. when I run this (simplified version): DECLARE @R char(40) DECLARE @U char(40) SET @R=' abcdefghijklmnopqrstuvwxyz!@#$%^&*()_+'+char(181) SET @U=REVE...

Get the last day of the month in SQL

I need to get the last day of the month given a date in sql. If I have the first day of the month I can do something like this: dateadd(day, dateadd(month,'2009-05-01',1), -1) But does anyone know how to generalize it so I can find the last day of the month for any given date? ...

SQL Query for information *not* in database

I have a large list of email addresses, and I need to determine which of them are not already in my database. Can I construct a query that will tell me this information? I am using SQL Server 2000, if it requires non-standard extensions ...

debug ssis package - reload InnerPackage.dtsx

Hi all, I used the wizard to build a package that loops through my tables does whatever. It has worked forever and now I have to change it. How on earth do I debug this thing? When I try to run it from bids, it opens InnerPackage.dtsx for editing and then asks me if I want to reload it (since it has changed since the last iteration o...

Database or flat file for 600K records?

Hi, I'm writing a C# application which needs to insert about 600K records into a database at a certain point in time. They are very simple records: just 3 longs. I'm using params to set up the command, and then loop through the data in memory to make the inserts, assigning the values to the command parameter's at each loop and runnin...

SqlConnection in .NET -- How can i best harness connection pooling?

I read that .NET uses connection pooling. And, for example, if I instantiate a bunch of SqlConnection objects with the same connection string, then internally .NET will know to use the same connection. Is this correct? And, in a big web-based application, any tips on the best way to harness this "power" ? Thanks. ...

SQL Server not visible in Server Explorer

Hi, If there is a SQL Server 2000 installed on a Server, and i have a VWD Express 2008 on a PC on that network, what could be the possible reasons for the SQL Server not being visible in the Server Explorer of the VWD ? Both PC's are on the same workgroup. I also tried keying in the name of the server, and the Login and password, but ...

Dropping an entire table

I plan to delete an entire table with over 930,000 rows of data. Which is the best way to do it without increasing the Log size or increasing the DB size. I am on a live site and my hosting has given me 150 MB of space..I am already using 125 MB and hence need to be careful of the DB size since increase in log will increase the size of ...

ASP.NET MVC newbie: can't get aspnet_regsql.exe to work

Hi, I just installed Web Developer Express 2008 and the MVC framework (followed all the defaults, SQL Server Express was installed in the process). I followed the initial NerdDinner steps, created a database from the IDE and defined tables (worked fine). To further define my tables, which heavily rely on the user-base, I had to figure...

Design db for questions and answers with tags on a blog page

Use XML files based or SQL server? Which would be more efficient based on storage size, retrieval and performance? ...

copy an identity column into another table

I have 2 tables that are related,both have identity columns for primary keys and i am using a vb form to insert data into them,My problem is that i cannot get the child table to get the primary key of the parent table and use this as its foreign key in my database. the data is inserted fine though no foreign key constraint is made.I am w...

Using SQL Express 2008 with VS2008?

I have the following installed: VS 2008 SP 1 ASP.NET MVC 1.0 SQL Express 2008 SQL Management Studio 2008 (for connecting to SQL2008 Server) When I right click on the App_Data Directory and click "Add New Item", if I choose SQL Server Database and name the .MDB file, I get an error: Connections to SQL Server Files (*.mdf) requir...

Maximum number of databases in sql server 2008

We are writing an ASP.Net/C# based program that will potentially be accessed by a number of companies (each having separate login and data). We are thinking of having multiple sql server 2008 databases (same instance), each for one company. However, the c# program that accesses the database will be the same and will create appropriate co...

Continue after primary key violation error

The problem is during inserting data from staging table during import routine. The system is a legacy one I inherited, and short term while I develop something more suitable I want to patch things to avoid the data transfer failing. Unfortunately the facility exists via another application to create an entry into table, called CommRece...

Get columns of a table SQL SERVER

Hi How can I get the name of all columns of a table in SQL SERVER 2008? Thank you ...

SQL Server to er model

Is there a program that converts a SQL Server database diagram to er model, or create er model of a database from SQL Server server? ...

SQL Server login for SharePoint site login errors SSO

I'm having a very confusing error between SharePoint and SQL Server 2k5. My SQL Server acting as backend to my MOSS farm has several logins in it which correspond to the web front end servers in my farm, with the pattern: {my-domain}{my-machine}$ Now, those accounts do not exist in AD anywhere, despite the login name syntax, and wer...

Dates in SQL Server consistently off by 12 hours

Our production platform technologies are these: PHP, MS SQL Sever, and IIS. PHP is set to the timezone 'Pacific/Auckland' which is current +12:00 GMT/UTC. When we retrieve dates from SQL Server, they are consistently 12 hours 'behind' what they should be, ie. SQL Server is storing and serving them as GMT dates, even though the time zon...