sql-server

Error loading SSIS packages using 32-bit dtexec on x64 machine

So, I have Integration Services packages that need to work with Excel files (shudder) and also need to execute on x64. I have a handle on the whole SSIS x64 vs. 32-bit issue, so I am scheduling these problem-child packages using MS suggested technique of using SQL Agent job step type Operating System / CMDExec, with a command line string...

How do I write a TSQL function that takes a table name to drop, and drops a table

Sorry, but I am new to TSQL so I don't even know basic things. I've been working on this function, but I've been running into a lot of syntax issues. If someone can assist me in writing this function, I would appreciate it. 1. I would like it to check for the existence of a table before attempting to drop the table 2. I would like ...

Extended Property Design

Suppose I have the following table schema: ID | Name | Width | Height | Size What are considerations to think about when breaking this table into two tables with one-to-one relationship? E.g.: ID | Name and ID | Width | Height | Size My concern is that I'll have a lot of columns on the table (not just five, here is for illustratio...

TSQL - how to find if a column has a space char(32)?

TSQL - how to find if a column has a space char(32)? select * from [sometable] where CHARINDEX(' ', [somecolumn]) > 0 doesn't work? Any ideas? ...

Is there any difference between DateTime in c# and DateTime in SQL server?

hi Is there any difference between DateTime in c# and DateTime in SQL server? ...

Is SQL Server 2005 Express good enough for development

At the company i develop, developers typically run databases on their laptops. We also have an instance of a SQL Server 2005 and SQL Server 2000 servers running as virtual machines, under an MSDN license. I am not a MSDN guru and not really familiar with the ins-and-outs of MSDN, so the my questions are as follows. Would each develope...

Why is ROW_NUMBER() not recognized in SQL Server 2008?

Why is ROW_NUMBER() not recognized as a function name in SQL Server 2008? I try this SELECT ROW_NUMBER() AS Row, Lname FROM MEN GO and I get this error: Msg 195, Level 15, State 10, Line 1 'ROW_NUMBER' is not a recognized function name. ...

SQL Server Migration To Refactored MySQL w/ InnoDB Key & Constraint Issues

I am redeveloping a web application and its infrastructure originally using SQL Server 2005, ASP.NET & Windows 2003 to a LAMMP (extra M for memcached of course) stack and since the schema is heavily refactored (with very good reason to do so) I must write a custom migration app. The problem is the InnoDB primary + foreign key constrain...

Is there a tool to migrate a SQL Express Database to SQL CE?

Are there any tools available (prefer if free) to transfer tables and data from SQL Express 2005 to SQL CE 3.5? I have a small app that uses SQL Express and since it is using Linq-to-SQL I want to change it to use SQL CE 3.5 so that users don't need to install the DB engine in order to use it and to simplify backups having them only cop...

Advantages to using Microsoft SQL Server with an open-source stack

SQL Server seems to have really terrific tools and features, enough to make me consider using it instead of MySQL, even though I'm doing development on an open source stack. Has anyone developed an app on a non-.NET stack and chosen to use SQL Server as your backend? What were your reasons for doing so? ...

How can I make a multi search SPROC/UDF by passing a tabled-value to it?

I actually want to achieve the following description This is the table argument I want to pass to the server <items> <item category="cats">1</item> <item category="dogs">2</item> </items> SELECT * FROM Item WHERE Item.Category = <one of the items in the XML list> AND Item.ReferenceId = <the corresponding value of ...

How to read and learn Execution plan of a T_SQL?

Hi How to read and learn Execution plan of a T_SQL statement? ...

Why can't I put a constraint on nvarchar(max)?

Why can't I create a constraint on an nvarchar(max) column? SQL Server will not allow me to put a unique constraint on it. But, it allows me to create a unique constraint on an nvarchar(100) column. Both of these columns are NOT NULL. Is there any reason I can't add a constraint to the nvarchar(max) column? ...

MySQL, MSSql, Oracle: When to use which?

What's the limitation? Is there a specific volume of data each can handle regardless of disk space? When to use what assuming licensing is not a problem? ...

How to Loop Datareader and create DataTable in Powershell

Hi, First of all let me thank those people that answered my previous questions. You guys are Awesome!!! Here is my question: I like to query my sql server Stored procedure and return a datareader. However I want to create a Table out of it. That table I will use to load excel using the new Powershell OpenXML commandlets. The code fails ...

Query too long in .NET 3.5 and SQL Compact 3.5

Hi, this is a rather pathetic problem: In Visual Basic 2008 Express with SQL Server Compact 3.5 and the Usual DataSet / TableAdapters, My Query is too long: Changing the names, it is a query like this: SELECT Table1.*, Table3.* FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.T1ID INNER JOIN Table3 ON T...

Fastest Way to Import?

Dear friends! What is the fastest way to import 15000000 records from Text File to SQL Server? Currently, I am importing data using Enterprise Manager, that takes 3-4 hours for importing into the SQL table. Thanks in advance! ...

Sql Server Intellisense?

Do you guys know of any free tool that does a nice job with the intellisense for SQL Server 05? SQLPrompt is just awesome, but they're not into giving their stuff for free :) ...

Updating records in SQL Server 2005 with ASP.NET 3.5 - HOW TO?

I have ALWAYS used the SQLDataSource to update my records in my SQL Server 2005 database, so i am not really sure how this would be done in normal code. I am using VB.NET but if you are a C# developer and want to show me some code that is more than welcome as well. I am using ASP.NET 3.5............... My user will see a page with 5 Te...

Calling bash from PsExec from SQL with xp_cmdshell

I am trying to call a bash command through a user account with PsExec. Cygwin is being used, and I am trying to run a command from SQL: exec master..xp_cmdshell 'psexec -u cyg_server -p <pwd> -accepteula "bash script.sh"'; However, I get the following error from psexec: Access is denied. PsExec could not start bash script.sh...