sql-server

VB.NET Pocket PC Database connection

Hi, I have created a database using SQlServer CE with the name of db.sdf using the following code. Dim connStr As String = "Data Source =\temp\emp.sdf;" Try 'creating database Dim engine As SqlCeEngine engine = New SqlCeEngine(connStr) engine.CreateDatabase() engine.Dispose() ...

T-SQL equivalent of PL/SQL %TYPE?

Is there any equivalent to %TYPE in MSSQL2005? CREATE TABLE TEST (ID NUMBER(5)); DECLARE myVar TEST.ID%TYPE; BEGIN ................ END; ...

TrimTrailingBlanks in SQL Server

In sp_help documentation doesn't says much about the property TrimTrailingBlanks of a table: TrimTrailingBlanks | varchar(35) | Trim the trailing blanks. Returns Yes or No. so I'm thinking if is good practice to turn it on or if I should let it's default off. What I want to do is to delete blanks from left and right strings, and (by t...

How do I move a table into a schema in T-SQL

I want to move a table into a specific Schema using T-SQL? I am using SQL Server 2008. ...

SQL Server Error!(microsoft sql-dmo odbc sqlstate 42000 )

Hello, I m using SQL Server 2000. I can't backup my database. Its show me a error Message.this is below ... Error Image What is the problem? ...

How would you skip vulgar words using base 36 against an Id column in sql server 08?

I need the shortest possible Ids so I figure base-36 would work wonderful for this. The thought is I'll just use an auto-incrementing Id field as the primary key and then create a base-36 userid. Unfortunately I'll inevitably run into a lot of vulgar word combinations. I'm having a hard time wrapping my head around the best approach to s...

Google search API versus MS SQL Server Full Text Indexing?

We are working on websites for our clients and we want to adopt a search solution that can be easily reused. Which one should we go after ? Should we use Google Search API or should we use MS Sql Server Full Text Indexing and the CONTAINS & FREETEXT predicates ? ...

WCF and SQL Server - how to handle data change?

I have an application with the architecture like client/server/db. Communication between client and server is WCF (has been migrated from asmx) and database is SQL Server 2005. The project has a requirement, that you cannot update an order, which have been changed (updated) by another user after your initial read. A common requirement i...

Writing a reusable data iterator for SQL Server 2005/2008

i am trying to write a data iterator for SQL, it looks like the best approach is to cook up some dynamic sql for this problem. I want the iterator to support paging, sorting, and filtering of the data, and ideally not iterate over a memory copy but to not even select the data in the first place, perhaps LINQ to SQL or Entity Framework w...

how to debug sql server queries

I am trying to test some query so i tried running it inside of SQL enterprise manager and i get the following error: EXECUTE permission denied on object 'sp_enable_sql_debug', database 'mssqlsystemresource', schema 'sys'. any suggestions? ...

how do you insert null values into sql server

in sql server enterprise manager, how do you write an insert statement with passing in null values ...

how to retrieve thousands of rows from a store procedure efficiently

Hello everyone, I am using VSTS 2008 + C# + .Net 3.0 + ADO.Net + SQL Server 2008. And from ADO.Net I am invoking a store procedure from SQL Server side. The store procedure is like this, SELECT Table1.col2 FROM Table1 LEFT JOIN Table2 USING (col1) WHERE Table2.col1 IS NULL My question is, how to retrieve the returned rows (Table1.col...

Do table hints in the view definition affect the view?

hi We know that we can use table hints when selecting records in our own queries. my question is: when we create a view and use table hints such as "Nolock", "Holdlock", etc ... and then save the view in SQL server, does the table hint we used affect the view? ...

Where content based websites store their content?

Sites like cnn.com or foxnews.com. Where do they store all the articles? In html files? In database? More logically to store everything in DB but how to generate a static link to something that is inside DB? It's not that they have a a dynamic page load like: LoadArticle.aspx?ArticleID=123, every article has it's own address. Please ...

What is the benefit of using "SET XACT_ABORT ON" in a stored procedure?

hi all. What is the benefit of using "SET XACT_ABORT ON" in a stored procedure? ...

What are the security risks using cmdexec?

Guys, We are in the process of migrating from SQL 2000 to SQL 2005. We have hundreds of DTS pacakges, that the development team is reluctant to redevelop using SSIS. When migrating these packages to SSIS, I am faced with a problem - many of these packages read from Excel files. Given that my production Box is 64 bit, I am forced to u...

Install : SQL Server Business Intelligence Development Studio

I have installed Microsoft SQL SERVER 2005. This consists of the Configuration tools(SQL server configuration manager,SQL Error and usage Reporting, Sql Sever Surface area configuration, Reporting Services configuration) and SQL Server Management Studio. However I dont find SQL Server Business Intelligence Development Studio. Can anyb...

First day Of this week and last week

Hi, I am currently getting first day Of this week and last week values with vbscript function in 2/12/2009 format. I was wondering if it was possible with SQL query. ...

Is it possible to substitute a value for null in a sql server select statement?

I am moving data from one table to another and I want a date field to change from null to a default value. What is the best way to do this in SQL Server(2000) ? I want something similar to the IIf function in Access. Like IIF(DateBegin is null, #1/1/2000#,DateBegin) ...

How do I "Install" a SQL Server Database to a Remote Server Without Physical Access?

I have a brand new database on an ISP which I intend to use to build an ASP.NET data-driven website. However, I would like to build the whole thing locally and transplant the database to the ISP. I have TCP/IP access (i.e. I can connect to the remote database directly thru SQL Server Management Studio Express), but I do not have Termin...