Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set default value for field?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
00818645
Message ID:
00818662
Vues:
28
Now that's easy to deduce.

What's tough is this code sample from the docs:
USE Northwind
DECLARE @var1 nvarchar(30)
SELECT @var1 = 'Generic Name'

SELECT @var1 = CompanyName
FROM Customers
WHERE CustomerID = 'ALFKA'

SELECT @var1 AS 'Company Name'
What the heck is going on here—can you figure it out?



>>BTW, what's all this '@' stuff about, anyway? What does an '@' do? I'm looking at the docs for @local_variable, but it's going way over my head...
>>
>
>The @ is just a requirement for naming your local vars in T-sql. I suppose it distinguishes variables from field and table names.
>
>DECLARE @state char(2)
>SET @state = 'UT'

Read about the greatest fraud in the history of mankind.
See TaxableIncome.net.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform