sql-server

How to do a SQL NOT NULL with a DateTime?

This might be simple, but I cant figure out how to do a simple DateTime with a NOT NULL? I want to do something like this: SELECT * FROM someTable WHERE thisDateTime IS NOT NULL But that obviously doesn't work. I am using MS SQL 2005 if that matters. Thank you. ...

Sorting nvarchar column as integer

Hi all. I have mixed data i nvarchar column (words and numbers). Which is fastest way to sort data in this column in Numeric Order. Result example: 1 2 3 ... 10 11 ... aaaa aaab b ba ba ... ...

Can't view full-text catalogs in SQL Server 2008 with Advanced Services

Hi, I'm using SQL Server 2008 with Advanced Services on my Vista Home Premium. I'd installed Full-text searching during installation, The SQL Full-text Filter Daemon Launcher is running thorough an admin user account. When I go to a database through the SQL Server Management Studio, I don't see the "Storage" option under the database, s...

Sql Server 2005 efficiency savings?

Are there good efficiency savings using Sql Server 2005 over Sql Server 2000? Or does it just have more services etc Has anyone seen their system work any quicker after making the upgrade? ...

Relative path in t sql?

How to get the relative path in t sql? Take for example a .sql file is located in the folder D:\temp, I want to get path of the file hello.txt in the folder D:\temp\App_Data. How to use the relative path reference? Let's say I am executing the sql file inside the SQL server management studio. ...

Can I create a BIDS project in VS2008 with SQL 2005?

From what I can find online about using VS2008 to create a integration/reporting services project it appears I need to have SQL 2008. Does anyone know of a work-around that would allow me to use VS2008 with SQL 2005? ...

Data in a table with carriage return?

In SQL SERVER Is it possible to store data with carriage return in a table and then retrieve it back again with carriage return. Eg: insert into table values ('test1 test2 test3 test4'); when i retrieve it, I get the message in a line test1 test2 test3 test4 The carriage return is treated as a single character. Is there way...

Cursor vs While loop. What are advantage/disadvantages of cursors - mssql

Is it a good idea to use while loop instead of cursor. What are advantage/disadvantages of cursors. ...

SqlParameter Size - negative effects of setting to max size?

I have a SqlCommand that I want to call Prepare() on whose CommandType = Text (it cannot be a stored procedure). In order to do this, I need to set the Size attribute on the parameters to be non-zero otherwise an exception is thrown. Are there any negative effects from setting the Size on all parameters to the maximum possible size eve...

What is the best way to store a large amount of text in a SQL server table?

What is the best way to store a large amount of text in a table in SQL server? Is varchar(max) reliable? ...

The best way for a SSIS ftp task to not fail when there are no files to copy

I'm using SQL Server 2005, and creating ftp tasks within SSIS. Sometimes there will be files to ftp over, sometimes not. If there are not, I don't want the task nor the package to fail. I've changed the arrow going from the ftp task to the next to "completion", so the package runs through. I've changed the allowed number of errors ...

Is there ever any reason not to take the advice of the Database Engine Tuning Advisor?

I'm on a team maintaining a .Net web app with a SQL Server 2005 back end. The system's been running a little slow in places lately, so after doing all the tuning kind of stuff we could think of (adding indexes, cleaning up really badly written stored procedures, etc.) I ran a typical workload through the Tuning Advisor - and it spit out...

SQL trace in Great Plains shows Invalid column name 'desSPRkmhBBCreh'.

This error seems to just pop up now and again. It is not restricted to a single table and even happens on tables it just created. Anybody else see this weird behavior? [Edit w/solution] It turns out that this query is used to determine if the table exists. Apparently it is much quicker to query an invalid column than just check for a...

How can I determine installed SQL Server instances and their versions?

I'm trying to determine what instances of sql server/sql express I have installed (either manually or programmatically) but all of the examples are telling me to run a SQL query to determine this which assumes I'm already connected to a particular instance. ...

jdbc driver for Microsoft SQL Server CE(Compact Edition) 3.5

hi there, I want to be able to explore the contents of a DB for this version of the DB. I was thinking of using the Squirrel DB client (which needs a JDBC driver). Therefore, I'm looking for a JDBC type 4 driver for SQL SERVER 3.5. Can somone point me to a FREE OR open source or trial ware ? If no JDBC driver, how do MS developers ex...

Potential Pitfalls of inserting millions of records into SQL Server 2005 from flat file

I am about to start on a journey writing a windows forms application that will open a txt file that is pipe delimited and about 230 mb in size. This app will then insert this data into a sql server 2005 database (obviously this needs to happen swiftly). I am using c# 3.0 and .net 3.5 for this project. I am not asking for the app, just ...

How do I find a default constraint using INFORMATION_SCHEMA?

I'm trying to test if a given default constraint exists. I don't want to use the sysbojects table, but the more standard INFORMATION_SCHEMA. I've used this to check for tables and primary key constraints before, but I don't see default constraints anywhere. Are they not there? (I'm using MS SQL Server 2000). EDIT: I'm looking to get b...

SQL Server Temp Tables and Connection Pooling

I have a multi-user ASP.NET app running against SQL Server and want to have StoredProcA create a #temptable temp table - not a table variable - to insert some data, then branch to StoredProcB, StoredProcC, and StoredProcD to manipulate the data in #temptable per business rules. The web app uses connection pooling when talking to SQL. ...

sql 2005 rollback transaction

I just did a delete from table How do I roll back or undelete the rows?? ...

Server based syntax highlighting in Management Studio

Why are some keywords highlighted blue and some gray in SQL Server Management Studio? And why does the UNION keyword highlight as gray when connected to a SQL Server 2000 database, but blue when connected to a SQL Server 2005 database? ...