Set minimum and exact length in bytes of column values in SQL Server
How can one set the column value length to a minimum and/or exact length using MS SQL Management Studio? ...
How can one set the column value length to a minimum and/or exact length using MS SQL Management Studio? ...
Hello, I'm using SQL Server 2008. I have a NVARCHAR(MAX) column called Title and i want to add an unique index for it. Because the column is bigger than 900bytes , I decided to create a HashBytes computed column (based on recommendation on StackOverflow). How do i create the HashBytes column? alter table Softs add TitleHash AS (has...
I've just ran into an unexpected behaviour for Entity framework entities in use with ASP.NET MVC application with SQL Server as datastore. For a column marked as not null allowed I did not set up data annotation Required attribute inside the entities' metadata partial class (I was under impression that I had to for all properties that I ...
This has been a problem that has existed on 3 projects for me. I have tried the following: <property name="connection.isolation">ReadCommitted</property> Set in hibernate.cfg.xml Using fluent nhiberate: MsSqlConfiguration.MsSql2008.IsolationLevel(IsolationLevel.ReadCommitted); Set in global.asax.cs I have always been forced to s...
id1 id2 year State Gender ==== ====== ====== ===== ======= 1 A 2008 ca M 1 B 2008 ca M 3 A 2009 ny F 3 A 2008 ny F 4 A 2009 tx F This is the table i have, I need to find the total No of distinct Count in this t...
Adding constraints in sql server comes under which category DML or DDL? ...
I have many databases in one SQL Server instance. Also I have many individual domain users for logins and also domain groups as logins. These logins are attached to databases as database users. Now I would like to create a report (or a query) to find out when and where (which database) these logins take a connection. I tried to find this...
The following code causes an exception when the Job table has no rows. public List<Job> getAll(int currentPage, int pageSize) { return this.sessionFactory.getCurrentSession() .createCriteria(Job.class).addOrder(Order.asc("id")) .setFirstResult(currentPage * pageSize).setMaxResults(pageSize) .setFetchSize(page...
Hi, i'm running a sql server replication to sync a table to a separate (reporting) database. In the source database, all records have a DateTime value (not so unusual) but it isn't stored as a DateTime, but as a Guid... which points to a table which contains all timestamps (one for every minute). Now what i would like to do is during ...
Greetings, I need to check whether the format of value stored database is correct. It should check for something like that: x-x x-xx xx-xx xxx-xxx etc. where xxx should be an integer. So the concept is to check if value has the following format: Integer - Integer ...
Need to retrieve a users IP, and my localhost is returning '::1' as the IP, and I am curious as to if this is expected behaviour Running MAMP on Snow Leopard. ...
I am using SQL Server 2005 and c#. I want to get primary key value when I insert record into database. For this I have a C# method in which I insert and update records. I am using ExecuteScalar method for inserting and updating. Insert record is successful but when I edit record then no update is successful. So tell me can I use Execu...
Hi there. I have a database which stores .png images as the sql "image" type. I have some code which retrieves these images as a byte[], and sends them to the page via the FileContentResult object in .Net. Performance is key in this application, and the images have to be retrieved and displayed as quickly as possible. My question is, can...
For example. I have a database upgrade script for adding a column to a database table. It looks a little like this: IF NOT Exists(SELECT * FROM SysColumns sc, SysObjects so WHERE sc.Name = 'dealer_number' AND so.Name = 'collector' AND so.Type= 'U' AND so.id = sc.id) BEGIN -- SQ...
I am using a trigger on a table to send an email using sp_send_dbmail. I want to include a file attachment in the email of an image type. The raw data for the jpeg is stored in the ndl_Image column which is of type binary. I have the following code:- DECLARE @ReferenceID varchar(max) DECLARE @Recipient varchar(Max) DECLARE @Body varc...
Hi, I'm not sure how best to approach this - I think a pivot / unpivot should be used, but not sure how to make it work (as pivoting column is a non-numeric) I have the following table (based on a query I can't modify): CREATE TABLE #data (donor_id NVARCHAR(50) ,last_gift DATETIME ,[2005] NVARCHAR(50) ,numgifts05 INT ,value_05 MONEY ,...
Guys, I have a task to do for my colleague and I need to know if is possible to specify the filter to subscribers when using replication in SQL Server? What I mean is, I don't want to create 3 types of publishers, each one to each one subscriber (with filter in publisher to redirect to specific subscriber but the inverse.) I want to in...
Hello all, Is there a way to change the results of a TSQL statement to an edit grid without having to right click on the table name in object explorer and choosing the "Edit Rows" option? Is there any way I can script it so I don't have to select the edit option everytime. Thanks in advance, .EGB ...
Many years ago (almost ten) I thought Index View is more like an enterprise edition (SQL 2000) only feature but I was wrong and Index view were indtroducted in SQL 2000 to satifsy competivive product's support for materialize view. However, You can still create index view and physically materialize that view in all the edition of SQL 20...
I'm trying to run a db:auto:migrate in my system and it keep throwing the undefined method `to_sym' for nil:NilClass whenever it gets to a column that uses a type of date. If I change the field to a datetime and run the migrate, it will change the field to a date with no errors. What is causing this problem. I have to keep changing th...