sql-server

C# SQL Parameter Errors in Loops

Please help me out with this. I have this small application to load txt files into a sql db and it works fine with sqlite. When I ported to SQL I started getting 'parameter already declared' errors.. If anyone can help me reorganize this code, it would be great! I need to get the parameter definitions outside of the loops or something.. ...

How can I store data in a table as a trie? (SQL Server)

Hi, To make things easier, the table contains all the words in the English dictionary. What I would like to do is be able to store the data as a trie. This way I can traverse the different branches of the trie and return the most relevant result. First, how do I store the data in the table as a trie? Second, how do I traverse the tr...

Copy data from one SQL Server database table to the other

I would like to copy the data from one table to another between different servers. If it is with in the same server and different databases, i have used the following SELECT * INTO DB1..TBL1 FROM DB2..TBL1 (to copy with table structure and data) INSERT INTO DB1..TBL1(F1, F2) SELECT F1, F2 FROM DB2..TBL1 (copy only data) Now my quest...

SQL Server 2005 FREETEXT() Perfomance Issue

I have a query with about 6-7 joined tables and a FREETEXT() predicate on 6 columns of the base table in the where. Now, this query worked fine (in under 2 seconds) for the last year and practically remained unchanged (i tried old versions and the problem persists) So today, all of a sudden, the same query takes around 1-1.5 minutes. ...

sql server - select top and bottom rows

Hi, I'm using Sql Server 2005 and i'm trying to achieve something like: In the same select statement i want to get the first x rows and the last x rows. SELECT TOP(5) BOTTOM(5) Of course 'bottom' does not exist so i need other solution. I believe there is an easy and elegant solution that i'm not getting. Doing the select again with...

best encryption method

What is the most standard encryption technique used in sql server for asp.net c# enterprise level application? . i am talking with respect to standards like md5 or sh1 etc, hashing ...

Access linked to sql server with relationships and lookup values

Hi all, I have a sql server database that several websites use. Now the customer wants this to be linked to an Access2007 program. Ive created a datasource file etc and have the tables linked to the database just fine. What I need is for the relationships between the tables to be able to create dropdown lookups so that when a user wants...

SQL Server - access to sys.views for a highly privileged user

I have case where I want a database user to have db_owner privileges with regard to one databases on the server, but be able to see absolutely nothing of other databases on the server, including, for example, the sys.databases view. I have tried denying select on this view at the master database level, but this prevents the user even fr...

How do you reset the sync schema for a table in Microsoft Sync Framework 2.0?

B"H If I setup a sync scope on two sql servers and syncing is working fine for a while? And then I need to change the schema for one of the tables. Lets say I need to add a column, or change the primary key. How do I go about doing this so that Microsoft Sync Framework still syncs that table properly? I assume that I run the change sc...

Service Broker not working after database restore

Have a working Service Broker set up on a server, we're in the process of moving to a new server but I can't seem to get Service Broker set up on the new box. Have done the obvious (to me) things like Enabling Broker on the DB, dropping the route, services, contract, queues and even message type and re adding them, setting ALTER QUEUE ...

connecting to secure database on private network from website host

Hello all, I've got a requirement to both read and write data via a .net webservice to a sqlserver database that's on a private network. this database is currently accessed via a vpn connection by remote client software (on standard desktop machines) to get latest product prices and to upload product stock sales. I've been tasked with f...

Reporting services subscription reports errors, but logs don't give details

Where can I find more detail about my subscription errors. I have a data driven subscription, showing status: Done: 24 processed of 24 total; 24 errors. but my trace file ReportServerService__xxxxx.log does not show any errors. It does show the subscription ran, but just no errors. My server DefaultTraceSwitch set to 3 and also trie...

What is this hacker trying to do?

If you do a search for: http://www.google.co.uk/search?q=0x57414954464F522044454C4159202730303A30303A313527&hl=en&start=30&sa=N you will see a lot of examples of an attempted hack along the lines of: 1) declare @q varchar(8000) select @q = 0x57414954464F522044454C4159202730303A30303A313527 exec(@q) -- What is exactly is ...

Debugging stored procedures, without using SSMS 2008 Debugger, or the Visual Studio debugger (output variable values?)

I have a SQL Server 2005 database with some Stored Procedures (SP) that I would like to debug...essentially I would just like to check variable values at certain points throughout the SP execution. I have SSMS 2008, but when I try to use the debugger, I get an error that it can't debug SQL Server 2005 databases. And I can't use the Vis...

How to detect a SQL Server database's read only status using tsql

I need to know how to interrogate my Microsoft SQL Server to know if a given database has been set to read only or not. Is that possible? ...

Possible way to attach database to exe

I created a small application using C# winforms that uses SQL Server as a database. Is there a way to attach the database to the exe file so I won't need to install SQL Server on all the machines that I want to run the program on? ...

SQL hidden techniques?

Possible Duplicate: Hidden Features of SQL Server What are those pro/subtle techniques that SQL provides and not many know about which also cut code and improve performance? eg: I have just learned how to use CASE statements inside aggregate functions and it totally changed my approach on things. Are there others? UPDATE: ...

Delete Stored Proc Deadlock in Sql Server

I am having the following deadlock in SQL Server 2005 with a specific delete stored proc and I can't figure out what I need to do to remedy it. <deadlock-list> <deadlock victim="processf3a868"> <process-list> <process id="processcae718" taskpriority="0" logused="0" waitresource="KEY: 7:72057594340311040 (b50041b389fe)" waittime="6...

Are there any modeling tools that help visualize how a 3NF model would look like against EAV?

Would like to find low-cost relational modeling tools that will allow me to map a logical model in third normal form to a physical model based on EAV. Got any pointers? ...

Write a plugin/form for SQL server enterprise manager

Is it possible to write a plugin or a form for SQL Server Enterprise Manager version 8? I'm doing some simple queries all the time to admin the databases. So wondering if I could write something for it. ...