I am storing Chinese and English text in an SQL Server 2005 database and displaying it on a webpage, but the Chinese is not being displayed correctly.
I have been reading about the subject and have done the following:
used N before the text in my INSERT statement
set the field type to nvarchar
set the charset of the page to UTF-8
Chi...
I'm a little rusty with my triggers and what not and am trying to figure out this problem for a class:
In a database TEST, tables do not have the option of the IDENTITY feature. In other words, when we insert a row into the table “Users”, we would like the primary key “UserID” to auto-increment. Please suggest a workaround to implement ...
I would like to know if in SQL is it possible to return a varchar value from a stored procedure, most of the examples I have seen the return value is an int
Example within a proc
declare @ErrorMessage varchar(255)
if @TestFlag = 0
set @ErrorMessage = 'Test'
return @ErrorMessage
...
Hi,
I want to know how to get user mapping details in sql server 2005,whether the login user has the permission on the database or not.
...
I am using SQL 2005 and SSIS..............
I have 2 data sources.
One from table A and one from table B. I want to move data from table A to table B. But first i get the MAX date from both and compare them. If they are the same then i must either stop the SSIS package or use the Conditional Split.
But when the MAX date from table B g...
Rightly or wrongly, I am using unique identifier as a Primary Key for tables in my sqlserver database. I have generated a model using linq to sql (c#), however where in the case of an identity column linq to sql generates a unique key on inserting a new record for guid /uniqueidentifier the default value of 00000000-0000-0000-0000-000000...
I recently inherited a warehouse which uses views to summarise data, my question is this:
Are views good practise, or the best approach?
I was intending to use cubes to aggregate multi dimensional queries.
Sorry if this is asking a basic question, I'm not experienced with warehouse and analyis services
Thanks
...
Web pages have moved to use URLs like:
//weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx
i.e. they include the title of the page in the url rather than having some coded id.
I understand that this is useful for SEO, and also for users in finding the correct page where they wish to type in the...
Hi all,
I have this situation where I have a SqlDatasource control and the select query is like:
SELECT col1, col2 FROM table1 WHERE colDate = @date
The source of @date is a label with the text: 2009-05-29 12:06:00
I get the following error when I run the query:
Conversion failed when converting date
and/or time from character ...
Hi
is it possible to create a view that selects from
multiple tables
in different databases
on different servers
using different login credentials
Can someone point to any online examples.
Or is there any way I can do it using Linq if I cant create a view
...
How can I find all of the foreign key dependencies on a particular column?
What are the different alternatives (graphically in SSMS, queries/views in SQL Server, 3rd party database tools, code in .NET)?
...
One category can have many products. I have to build StoredProcedure that returns all categories with some data from Products combined into one field:
SP Result:
idCategory Name ProductNames ProductQuantities
1 Cat1 Procut1,Product2 24,32
2 Cat2 ProductX,ProductY 0,61
ProductNames and Product...
I have a stored procedure with multiple insert/select statements. Let's say I'm using the first insert to populate a "Manager" table. On insert, a ManagerId (incremented automatically) is added, but not referenced in the insert statement. I then wish to use the ManagerId from this table to insert a row into another table, where Manage...
I have a recursive table in which each record has an ID and a PARENTID. PARENTID points to a different ID in the same table. Is there a way in SQL Server to select an entire "tree" in one statement? I could write a recursive function to jump from a parent to all the children, but I'd like a way to do it in one query.
In Oracle, it wo...
How can I attach a database without an LDF file in SQL Server?
...
Lets say I have a table with columns such as:
ID
Name
City
State
ZIP
I need to write a query that will return only one row. This row will include City, State, and ZIP, but I only want a field to have a value if all values in the results set are the same, otherwise I want the field to be null.
For example, if every record has the sam...
Hi all,
I have a couple of tables which look like this
Table 1
user_id | name
-------------------------
x111 | Smith, James
x112 | Smith, Jane
etc..
Table 2
id | code | date | incident_code | user_id
-----------------------------------------------------------------
1 | 102008 | 10/2...
I've only been using SSIS briefly, but I find that my complaints are numerous. Here are my current issues:
In order for a package to store a password, you need to encrypt it. Even if the package is part of a larger solution, you need to supply a password anytime to open any of the encrypted packages. Why can't you just encrypt the w...
e.g. Make it so that you could limit it to a max 2 connections for a given technical account, the third connection being blocked repeatedly until one of the others is given up
...
I wrote a trigger that updates local table and similar table on linked server.
CREATE TRIGGER myTtableUpdate ON myTable
AFTER UPDATE
AS
IF (COLUMNS_UPDATED() > 0)
BEGIN
DECLARE @retval int;
BEGIN TRY
EXEC @retval = sys.sp_testlinkedserver N'my_linked_server';
END TRY
BEGIN CATCH
SET @retval = sign(@@error);
END CAT...