sql-server

file storage in sql server

thank u all who response for my query its really to helpfull now i hav facing 1 more problem actually i m design a website for education domain so in education system no. of letters n documents come n i want to store that wole document in database(SQL SERVER 2005 n 2008) with few attribute as doc_id, type etc... so please help to implem...

Largest text usable variable in MSSQL 2005 Stored Procedure?

What is the largest size text usable variable in a MSSQL Stored Procedure. I'm seeing that largest size you can use is a varchar(8000). We can use ntext, text, etc. So does it require stitching varchars together? What about if I used a CLR Stored Procedure?? ...

Data source controls and parameter type conversion

Hello, Q1 - In the code example below runtime converts a value between two incompatible types: <SelectParameters> <asp:Parameter Name="City" Type="Int32" /> </SelectParameters> protected void SqlDataSource2_Selecting(object sender, SqlDataSourceSelectingEventArgs e) {e.Command.Parameters["@City"].Value = "100";} Except...

How should I approach migrating data from a "bad" database design to a usable design?

The current project I inherited mainly revolves around one unnormalized table. There are some attempts at normalization but the necessary constraints weren't put in place. Example: In the Project table, there is a client name (among other values) and there is also a clients table which just contains client names [no keys anywhere]. T...

Any good SQL Server Management software for Mac OS?

I am used to using SQL Management Studio Express on Windows and was wondering if there were any good ones with similar functionality and price (free) for Mac OS X. ...

& operator in a SQL Server WHERE Clause

Sorry for the very basic question. What does the & operator do in this SQL WHERE (sc.Attributes & 1) = 0 sc is an alias for a table which contains a column attributes. I'm trying to understand some SQL in a report and that line is making it return 0 entries. If I comment it out it works. I have limited SQL knowledge and I'm not sure ...

Reusing SqlCommand ?

I am not really sure if it is possible or not. I am currently working on the college project and i have a function that uses stored procedure. I would like to know if it is possible to take same SqlCommant apply updated parameters and call to the stored procedure again withing same function. Lets say i have something like that in my cod...

How can I solve a connection pool problem between ASP.NET and SQL Server?

The last few days we see this error message in our website too much: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached." We have not changed anything in our code in a while. I revised ...

Creating a database from .mdf file in MS Access

I have a .mdf which I need to import into MS Access. I have read that .mdf is a Sql Server format so Access wont recognize it. But is there some way I can get the database created in MS Access. I am using Access 2003 and Sql Server 2005 ...

How to version control SQL Server databases?

I have SQL Server databases and do changes in them. Some database tables have records that are starting records required my app to run. I would like to do version control over database and these records (rows). Is it possible to do this and bundle it to SVN version control I have for my source code or are there other solutions to this? I...

SQL Server 2005 "FOR XML PATH" Multiple tags with same name

I have an XML structure like the following <root> <person> <name>James</name> <description xsi:type="me:age">12</description> <description xsi:type="me:height>6 foot</description> ... Which I have to pull out of a table like ... Person Name , Age , Height I'm trying to use the FOR XML path stuff in SQL 2...

Stored procedures and the tables used by them

Hi people! Is there a way to know what are the tables used by one stored procedure by doing an SQL query? Best regards, and thanks for the help. P.S.: I'm using SQL Server 2005. ...

Is a duration of 394 when executing a SQL query too much?

I had this connection pool problem: How to solve a connection pool problem between ASP.NET and SQL Server? And I am now tracing using the SQL profiler, and I found some queries take about 400 duration to finish and return data. Is that value too much? Could it cause the previous connection pool problem? ...

Modulo arithmetic on dates in SQL

I have a system which defines repeating patterns of days. Each pattern has a base date (often a few years in the past, when the pattern was created) and a day count (which loops), so for example it might define a pattern for a seven day period: Table: Pattern ID | BaseDate | DayCount ----------------------------- 1 | 01/02/2005 | 7 ...

Is more than 100 active connection to SQL server db not normal in an ASP.NET website?

While tracing the active connection on my db i found that some times the connections exceeds 100, is that normal? and after few minutes it return back to 20 or 25 active connection more details about my problem Traffic on the site is around 200 visitor per day. Why i am asking? because the default MaxPool in the asp.net connection strin...

How do I control what user name Crystal Enterpise uses when making trusted connections to SQL server?

We are updating a Crystal Report to connect to SQL server (the database was moved from Oracle), and we are trying to make it connect to SQL server using an active directory account. I was able to get this working on my local machine using my own account, but when I deploy it to the Crystal Enterprise server, the connection fails. It appe...

Ordering SQL Results based on Input Params

In conjunction with the fn_split function, I'm returning a list of results from a table based on comma separated values. The Stored Procedure T-SQL is as follows: SELECT ProductCode, ProductDesc, ImageAsset, PriceEuros, PriceGBP, PriceDollars, replace([FileName],' ','\_') as [filename], ID as FileID, weight from Products LEFT O...

XML Reader on SQL Table returning invalid XML

I have SQL table that has a varchar(8) column that occasionally has binary data in it. (0x01, 0x02, etc...). (Changing the format or the content of the column isn't an option.) When I go into the SQL Server 2005 Management Studio and run the query: select * from mytable where clientID = 431620 for xml auto I get useful results...

How to find a text inside SQL Server procedures / triggers?

I have a linkedserver that will change. Some procedures call the linked server like this: "[10.10.100.50].dbo.SPROCEDURE_EXAMPLE". We have triggers also doing this kind of work. We need to find all places that uses "[10.10.100.50]" to change it. In SQL Server Management Studio Express I didn't find this feature, a "find in whole databas...

How to reduce flooding a Service Broker queue?

I'm new to using the SQL Service 2005 Service Broker. I've created queues and successfully got conversations going, etc. However, I want to sort of "throttle" messages, and I'm not sure how to go about that. Messages are sent by a stored proc which is called by a multi-user application. Say 20 users cause this proc to be called once ...